diff --git a/dbcon/joblist/distributedenginecomm.cpp b/dbcon/joblist/distributedenginecomm.cpp index a43f5cd24..a2fd41e1a 100644 --- a/dbcon/joblist/distributedenginecomm.cpp +++ b/dbcon/joblist/distributedenginecomm.cpp @@ -278,9 +278,9 @@ void DistributedEngineComm::Setup() // numConnections must be calculated as number of PMs * number of connections per PM. // This happens earlier in getNumConnections(). - for (unsigned i = 0; i < numConnections; i++) + for (size_t i = 0; i < numConnections; ++i) { - size_t connectionId = numConnections % newPmCount; + size_t connectionId = i % newPmCount; boost::shared_ptr cl(new MessageQueueClient(pmsAddressesAndPorts[connectionId].first, pmsAddressesAndPorts[connectionId].second)); boost::shared_ptr nl(new boost::mutex());