Skip to content

Commit

Permalink
HPCC-32422 Fix lookupjoin regression (introduced by HPCC-32313)
Browse files Browse the repository at this point in the history
Signed-off-by: Jake Smith <[email protected]>
  • Loading branch information
jakesmith authored and GordonSmith committed Aug 13, 2024
1 parent 9a44c2e commit 1e38c14
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions system/jlib/jqueue.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ public:
stopped = false;
}

bool queryStopped() const { return stopped; }

bool enqueue(BASE *e,unsigned timeout=INFINITE)
{
unsigned numToSignal = 0;
Expand Down
11 changes: 9 additions & 2 deletions thorlcr/activities/lookupjoin/thlookupjoinslave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ class CBroadcaster : public CSimpleInterface

// in theory each worker could be sending log(n) packets, with the broadcaster on each blocking waiting for acks
unsigned limit = nodes * std::ceil(std::log2(nodes));
broadcastQueue.setLimit(limit);
limit = broadcaster.activity.getOptInt("lookupJoinBroadcastQLimit", limit);
if (0 != limit)
broadcastQueue.setLimit(limit);
}
~CSend()
{
Expand All @@ -203,8 +205,13 @@ class CBroadcaster : public CSimpleInterface
return;
}
}
while (!broadcastQueue.enqueue(sendItem, 5000)) // will block if queue full
while (!broadcastQueue.enqueue(sendItem, 20000)) // will timeout if queue full
{
if (broadcastQueue.queryStopped())
{
DBGLOG("broadcastQueue stopped");
break;
}
DBGLOG("CSend::addBlock() - broadcastQueue full, waiting for space");
}
}
Expand Down

0 comments on commit 1e38c14

Please sign in to comment.