Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-32941 Log warning if input time is more than total time #19268

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion common/thorhelper/thorcommon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,13 @@ class THORHELPER_API ActivityTimeAccumulator
cycle_t firstExitCycles; // Wall clock time of first exit from this activity
cycle_t blockedCycles; // Time spent blocked
cycle_t lookAheadCycles; // Time spent by lookahead thread

unsigned activeActivityTimers = 0; // Number of active activity timers
// Return the total amount of time (in nanoseconds) spent in this activity (first entry to last exit)
inline unsigned __int64 elapsed() const { return cycle_to_nanosec(endCycles-startCycles); }
// Return the total amount of time (in nanoseconds) spent in the first call of this activity (first entry to first exit)
inline unsigned __int64 latency() const { return cycle_to_nanosec(latencyCycles()); }
inline cycle_t latencyCycles() const { return firstExitCycles-startCycles; }
inline unsigned queryNumActiveTimers() const { return activeActivityTimers; }

void addStatistics(IStatisticGatherer & builder) const;
void addStatistics(CRuntimeStatisticCollection & merged) const;
Expand Down Expand Up @@ -291,6 +292,7 @@ class ActivityTimer
accumulator.startCycles = startCycles;
accumulator.firstRow = getTimeStampNowValue();
}
++accumulator.activeActivityTimers;
}
else
startCycles = 0;
Expand All @@ -306,6 +308,7 @@ class ActivityTimer
accumulator.totalCycles += elapsedCycles;
if (unlikely(isFirstRow))
accumulator.firstExitCycles = nowCycles;
--accumulator.activeActivityTimers;
}
}
};
Expand Down
7 changes: 5 additions & 2 deletions thorlcr/graph/thgraphslave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,11 +588,14 @@ unsigned __int64 CSlaveActivity::queryLocalCycles() const
}
}
unsigned __int64 processCycles = queryTotalCycles() + queryLookAheadCycles();
if (processCycles < inputCycles) // not sure how/if possible, but guard against
if (processCycles < inputCycles && slaveTimerStats.queryNumActiveTimers()==0) // not sure how/if possible, but guard against
{
ActPrintLog("CSlaveActivity::queryLocalCycles - process %" I64F "uns < inputCycles %" I64F "uns", cycle_to_nanosec(processCycles), cycle_to_nanosec(inputCycles));
return 0;
}
processCycles -= inputCycles;
const unsigned __int64 blockedCycles = queryBlockedCycles();
if (processCycles < blockedCycles)
if (processCycles < blockedCycles && slaveTimerStats.queryNumActiveTimers()==0)
{
ActPrintLog("CSlaveActivity::queryLocalCycles - process %" I64F "uns < blocked %" I64F "uns", cycle_to_nanosec(processCycles), cycle_to_nanosec(blockedCycles));
return 0;
Expand Down
Loading