mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07: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:
parent
08a2338277
commit
2f932d8767
5 changed files with 17 additions and 10 deletions
|
@ -726,7 +726,7 @@ class TaskExecutor:
|
|||
|
||||
conn_type = self._play_context.connection
|
||||
|
||||
connection = self._shared_loader_obj.connection_loader.get(conn_type, self._play_context, self._new_stdin)
|
||||
connection = self._shared_loader_obj.connection_loader.get(conn_type, self._play_context, self._new_stdin, ansible_playbook_pid=to_text(os.getppid()))
|
||||
if not connection:
|
||||
raise AnsibleError("the connection plugin '%s' was not found" % conn_type)
|
||||
|
||||
|
@ -800,7 +800,7 @@ class TaskExecutor:
|
|||
Starts the persistent connection
|
||||
'''
|
||||
master, slave = pty.openpty()
|
||||
p = subprocess.Popen(["ansible-connection"], stdin=slave, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
p = subprocess.Popen(["ansible-connection", to_text(os.getppid())], stdin=slave, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
stdin = os.fdopen(master, 'wb', 0)
|
||||
os.close(slave)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue