Skip to content

Commit

Permalink
Merge pull request #19287 from ghalliday/issue32759
Browse files Browse the repository at this point in the history
HPCC-32759 Fix deadlock in unordered concat activity with rows > 2MB

Reviewed-by: Jake Smith <jake.smith@lexisnexisrisk.com>
Merged-by: Gavin Halliday <ghalliday@hpccsystems.com>
  • Loading branch information
ghalliday authored Nov 11, 2024
2 parents 8f52b8a + 10f19a1 commit d1006bd
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions thorlcr/activities/funnel/thfunnelslave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,22 @@ class CParallelFunnel : implements IRowStream, public CSimpleInterface
}
void informEos(unsigned input)
{
CriticalBlock b(crit);
eoss++;
if (eoss == inputHandlers.ordinality())
rows.enqueue(NULL);
unsigned numToSignal = 0;
{
CriticalBlock b(crit);
eoss++;
if (eoss == inputHandlers.ordinality())
rows.enqueue(NULL);
// If the row sizes are very large then it is possible that other threads are waiting
// signal one of them that it can continue - because this thread will add no more records (HPCC-32759)
if (waiting && (totSize <= FUNNEL_MIN_BUFF_SIZE))
{
numToSignal = 1;
waiting--;
}
}
if (numToSignal)
fullSem.signal(numToSignal);
}
void abort()
{
Expand Down

0 comments on commit d1006bd

Please sign in to comment.