Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion salt/transport/zeromq.py
Original file line number Diff line number Diff line change
Expand Up @@ -1164,9 +1164,15 @@ def _init_socket(self):
# never reclaims routing-id table entries. On daemon restart
# slots replay in construction order and overwrite the prior
# master-side entries cleanly.
identity = "salt-req/{role}/{minion_id}/{slot}".format(
# Include os.getpid() in the identity so that one-off
# processes (salt-call, salt-run, etc.) that set __role=minion
# never collide with the long-running salt-minion daemon's
# identity slots. Without this, ROUTER_HANDOVER on the master
# silently drops replies still in flight to the original owner.
identity = "salt-req/{role}/{minion_id}/{pid}/{slot}".format(
role=_role,
minion_id=_minion_id,
pid=os.getpid(),
slot=next(_REQ_IDENTITY_SLOT),
)
self.socket.setsockopt(zmq.IDENTITY, identity.encode("utf-8"))
Expand Down