shuts down persistent connections at end of play run (#32825)

This change will now track any created persistent connection and shut it
down at the end of the play run.  This change also includes an update to
properly honor the reset_connection meta handler.
This commit is contained in:
Peter Sprygada 2017-11-22 10:30:06 -05:00 committed by John R Barker
parent 9d56ffa4ed
commit 69575e25d0
7 changed files with 62 additions and 32 deletions

View file

@ -209,6 +209,15 @@ class Connection(ConnectionBase):
return 0, to_bytes(self._manager.session_id, errors='surrogate_or_strict'), b''
def reset(self):
'''
Reset the connection
'''
if self._socket_path:
display.vvvv('resetting persistent connection for socket_path %s' % self._socket_path, host=self._play_context.remote_addr)
self.close()
display.vvvv('reset call on connection instance', host=self._play_context.remote_addr)
def close(self):
if self._manager:
self._manager.close_session()