Skip to content

Commit

Permalink
Merge pull request #18245 from richardkchapman/garbled-ping
Browse files Browse the repository at this point in the history
HPCC-31136 Spurious "PING reply, garbled result" tracing

Reviewed-by: Mark Kelly [email protected]
Reviewed-by: Gavin Halliday <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Jan 25, 2024
2 parents 8e68842 + d62dbeb commit 6fe9800
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions roxie/ccd/ccdqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ static MapXToMyClass<hash64_t, hash64_t, IQueryFactory> onDemandQueryCache;
void sendUnloadMessage(hash64_t hash, const char *id, const IRoxieContextLogger &logctx)
{
RemoteActivityId unloadId(ROXIE_UNLOAD, hash);
RoxiePacketHeader header(unloadId, 0, 0, 0);
RoxiePacketHeader header(unloadId, RUID_DISCARD, 0, 0);

MemoryBuffer mb;
mb.append(sizeof(RoxiePacketHeader), &header);
Expand Down Expand Up @@ -2706,7 +2706,7 @@ class RoxieSocketQueueManager : public RoxieReceiverBase
#endif
Owned<ISerializedRoxieQueryPacket> packet = createSerializedRoxiePacket(mb);
unsigned retries = header.thisChannelRetries(mySubchannel);
if (acknowledgeAllRequests && (header.activityId & ~ROXIE_PRIORITY_MASK) != ROXIE_PING)
if (acknowledgeAllRequests && (header.activityId & ~ROXIE_PRIORITY_MASK) < ROXIE_ACTIVITY_SPECIAL_FIRST)
{
#ifdef DEBUG
if (testAgentFailure & 0x1 && !retries)
Expand Down Expand Up @@ -3895,7 +3895,7 @@ class PingTimer : public Thread
try
{
RemoteActivityId pingId(ROXIE_PING | priorityMask, 0);
RoxiePacketHeader header(pingId, 0, 0, 0);
RoxiePacketHeader header(pingId, RUID_PING, 0, 0);

MemoryBuffer mb;
mb.append(sizeof(RoxiePacketHeader), &header);
Expand Down Expand Up @@ -3947,21 +3947,29 @@ class PingTimer : public Thread
unsigned headerLen;
const RoxiePacketHeader *header = mr->getMessageHeader(headerLen);
Owned<IMessageUnpackCursor> mu = mr->getCursor(rowManager);
PingRecord *answer = (PingRecord *) mu->getNext(sizeof(PingRecord));
if (answer && mu->atEOF() && headerLen==sizeof(RoxiePacketHeader))
if (header->activityId == ROXIE_PING)
{
unsigned elapsed = usTick() - answer->tick;
pingsReceived++;
pingsElapsed += elapsed;
if (doTrace(traceRoxiePings, TraceFlags::Max))
DBGLOG("PING reply channel=%d, time %d", header->channel, elapsed); // DBGLOG is slower than the pings so be careful!
PingRecord *answer = (PingRecord *) mu->getNext(sizeof(PingRecord));
if (answer && mu->atEOF() && headerLen==sizeof(RoxiePacketHeader))
{
unsigned elapsed = usTick() - answer->tick;
pingsReceived++;
pingsElapsed += elapsed;
if (doTrace(traceRoxiePings, TraceFlags::Max))
DBGLOG("PING reply channel=%d, time %d", header->channel, elapsed); // DBGLOG is slower than the pings so be careful!
}
else
{
StringBuffer s;
DBGLOG("PING reply, garbled result %s", header->toString(s).str());
}
ReleaseRoxieRow(answer);
}
else
{
StringBuffer s;
DBGLOG("PING reply, garbled result %s", header->toString(s).str());
DBGLOG("PING reply, unexpected result %s", header->toString(s).str());
}
ReleaseRoxieRow(answer);
}
else if (!anyActivity)
{
Expand Down

0 comments on commit 6fe9800

Please sign in to comment.