Skip to content

Conversation

@GaneshPatil7517
Copy link

@GaneshPatil7517 GaneshPatil7517 commented Feb 12, 2026

@pradeeban

Problem

PairedTransmitter was being created and destroyed inside every loop iteration in 0mq/funcall.py.
This caused excessive ZMQ socket churn, thread creation overhead, and potential port rebinding failures due to TIME_WAIT state.

Solution

  • Moved transmitter initialization and background thread start outside the loop
  • Added try/finally to ensure proper cleanup after loop execution

Impact

  • Improved performance
  • Prevents socket exhaustion
  • Proper resource lifecycle management
  • No functional behavior change

(#268)

Copilot AI review requested due to automatic review settings February 12, 2026 12:22
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the resource lifecycle in the 0mq/funcall.py ZMQ client loop by reusing a single PairedTransmitter instance instead of creating/tearing it down every iteration, avoiding repeated socket/thread churn.

Changes:

  • Instantiate PairedTransmitter once before the simulation loop.
  • Start background sync once and stop it once using a try/finally to guarantee cleanup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant