Skip to content

Commit

Permalink
HPCC-32933 Fix execute timings for loop activity
Browse files Browse the repository at this point in the history
Track execute timings are incurred by CATCH_NEXTROW.  And remove
execute timings in getNextRow as it is executed by the CNextRowLoader
thread.

Signed-off-by: Shamser Ahmed <shamser.ahmed@lexisnexis.com>
  • Loading branch information
shamser committed Jan 7, 2025
1 parent 0e602df commit 69069f8
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions thorlcr/activities/loop/thloopslave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,20 +297,39 @@ class CLoopSlaveActivity : public CLoopSlaveActivityBase
}
const void *getNextRow(bool stopping)
{
ActivityTimer t(slaveTimerStats, timeActivities);
if (!abortSoon && !eof)
{
unsigned emptyIterations = 0;
while (!abortSoon)
{
while (!abortSoon)
{
OwnedConstThorRow ret = (void *)curInput->nextRow();
if (!ret)
OwnedConstThorRow ret;
{
ret.setown(curInput->nextRow()); // more cope with groups somehow....
if (!ret)
break;
if (loopCounter==1)
{
// The disk reads occur in the first iteration only so track lookahead time
// in the first iteration only. In subsequent iterations, it is reading the
// output from previous iterations.
LookAheadTimer t(slaveTimerStats, timeActivities);
ret.setown(curInput->nextRow());
if (!ret)
{
ret.setown(curInput->nextRow()); // more cope with groups somehow....
if (!ret)
break;
}
}
else
{
ret.setown(curInput->nextRow());
if (!ret)
{
ret.setown(curInput->nextRow()); // more cope with groups somehow....
if (!ret)
break;
}
}
}

if (finishedLooping ||
Expand Down Expand Up @@ -439,6 +458,7 @@ class CLoopSlaveActivity : public CLoopSlaveActivityBase
}
CATCH_NEXTROW()
{
ActivityTimer t(slaveTimerStats, timeActivities);
return nextRowFeeder->nextRow();
}
virtual void stop() override
Expand Down

0 comments on commit 69069f8

Please sign in to comment.