mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Add parent pid to persistent connection socket path hash (#33518)
* Add parent pid to persistent connection socket path hash Fixes #33192 * Add parent pid in persistent connection socket path hash to avoid using same socket path for multiple simultaneous connection to same remote host. * Ensure unique persistent socket path for each ansible-playbook run * Fix CI failures
This commit is contained in:
@@ -315,11 +315,13 @@ class Connection(ConnectionBase):
|
||||
return self
|
||||
|
||||
@staticmethod
|
||||
def _create_control_path(host, port, user, connection=None):
|
||||
def _create_control_path(host, port, user, connection=None, pid=None):
|
||||
'''Make a hash for the controlpath based on con attributes'''
|
||||
pstring = '%s-%s-%s' % (host, port, user)
|
||||
if connection:
|
||||
pstring += '-%s' % connection
|
||||
if pid:
|
||||
pstring += '-%s' % to_text(pid)
|
||||
m = hashlib.sha1()
|
||||
m.update(to_bytes(pstring))
|
||||
digest = m.hexdigest()
|
||||
|
||||
Reference in New Issue
Block a user