As detailed in issue #1088, the FairQueueing class in NetMQ is prone to a DivideByZeroException when all inbound pipes are deactivated and m_active becomes zero. This issue occurs during the round-robin selection process in the RecvPipe method.
Solution
This pull request implements a conditional check to ensure that the modulo operation for round-robin scheduling is only performed when there is at least one active pipe (m_active > 0). This change prevents the system from attempting a division by zero, which can lead to an application crash under specific scenarios.
Changes Made
Modified the round-robin index update line in RecvPipe method to:
Problem
As detailed in issue #1088, the
FairQueueing
class in NetMQ is prone to aDivideByZeroException
when all inbound pipes are deactivated andm_active
becomes zero. This issue occurs during the round-robin selection process in theRecvPipe
method.Solution
This pull request implements a conditional check to ensure that the modulo operation for round-robin scheduling is only performed when there is at least one active pipe (
m_active > 0
). This change prevents the system from attempting a division by zero, which can lead to an application crash under specific scenarios.Changes Made
RecvPipe
method to: