saltstack / saltstack/salt

3008.x: IPC socket mismatch between RequestServer.zmq_device and MWorkers when using workaround for #69911

Open
#69,912 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description

Related to #69911. On 3008.x, when working around #69911 by setting both worker_pools_enabled: False and explicit worker_pools: config, the legacy RequestServer.zmq_device and MWorker workers bind to different IPC sockets and cannot communicate. The master accepts connections on 4506 but every auth times out because MWorkerQueue and workers never see each others' messages.

Log evidence
[INFO   ][186] RequestServer workers ipc:///var/run/salt/master/workers.ipc
[INFO   ][187] Worker binding to socket ipc:///var/run/salt/master/workers-default.ipc
[INFO   ][190] Worker binding to socket ipc:///var/run/salt/master/workers-default.ipc
[INFO   ][191] Worker binding to socket ipc:///var/run/salt/master/workers-default.ipc

The MWorkerQueue (RequestServer.zmq_device, pid 186) binds workers.ipc because its pool_name opt is empty at the RequestServer level. The MWorkers (pids 187/190/191, post-fork) each pick up pool_name="default" from the worker_pools config and bind workers-default.ipc.

Root cause

salt/transport/zeromq.py:513 zmq_device() derives w_uri from self.opts.get("pool_name", ""), which is empty for the top-level RequestServer. MWorker's post_fork path reads pool config independently and picks the per-pool socket name, so the two disagree whenever worker_pools_enabled is False but worker_pools is still defined (the workaround for #69911).

Reproduction (starting from a running 3008.x master):
# master config
worker_pools_enabled: False
worker_pools:
  default:
    worker_count: 3
    commands: ["*"]

Restart; the master starts without crashing but every salt '*' test.ping times out.

Suggested fix

Either

  1. zmq_device needs to derive w_uri using the same pool naming logic MWorker post_fork uses when worker_pools is defined, even if worker_pools_enabled is False, or
  2. MWorker post_fork should skip the pool naming when worker_pools_enabled is False, or
  3. Fix #69911 upstream so the legacy path doesn't need this workaround.

Version: 3008.2+152.g4a10864f6a (CI RPM from PR #69908).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at salt/transport/zeromq.py:513, then trace the MWorker post_fork path that selects the pool socket. Reproduce with worker_pools_enabled: False and an explicit default worker_pools configuration, and compare the sockets bound by RequestServer.zmq_device and MWorkers. Done means both sides use a compatible socket and salt '*' test.ping completes instead of timing out.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.