Skip to content

Move ZMQ socket bind to poll thread to prevent blocking#73

Open
ypcisco wants to merge 2 commits into
Azure:202506from
ypcisco:zmqserver_move_bind_to_poll_thread
Open

Move ZMQ socket bind to poll thread to prevent blocking#73
ypcisco wants to merge 2 commits into
Azure:202506from
ypcisco:zmqserver_move_bind_to_poll_thread

Conversation

@ypcisco
Copy link
Copy Markdown

@ypcisco ypcisco commented Feb 2, 2026

Why I did it

  • In scale scenarios, zmq_bind() can take significant time to complete
  • Orchestration agent gets blocked during ZmqServer initialization
  • Synchronous bind in main thread delays startup and impacts system responsiveness

How I did it

  • Moved zmq_bind() call from ZmqServer::bind() to mqPollThread()
  • Socket creation and configuration remain in main thread
  • Actual bind operation now happens in background poll thread

Signed-off-by: Yash Pandit <ypcisco@gmail.com>
Signed-off-by: Yash Pandit <ypcisco@gmail.com>
@ypcisco ypcisco closed this Feb 2, 2026
@ypcisco ypcisco reopened this Feb 2, 2026
Copy link
Copy Markdown

@anish-n anish-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add some more details about what scale scenario causes zmq bind to be slow, and how does that scenario result in slowness?

@ypcisco
Copy link
Copy Markdown
Author

ypcisco commented Feb 24, 2026

Could we add some more details about what scale scenario causes zmq bind to be slow, and how does that scenario result in slowness?

@anish-n this PR doesn't resolve the zmq_bind slowness but prevents it from blocking orchagent. We don't yet know what causes zmq_bind to take 4-5 minutes during scale scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants