From d62dbeb74c33e18bebc1e62a1d31b482d923f493 Mon Sep 17 00:00:00 2001 From: Richard Chapman Date: Wed, 24 Jan 2024 14:58:32 +0000 Subject: [PATCH] HPCC-31136 Spurious "PING reply, garbled result" tracing UNLOAD messages were getting confused with PING messages Signed-off-by: Richard Chapman --- roxie/ccd/ccdqueue.cpp | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/roxie/ccd/ccdqueue.cpp b/roxie/ccd/ccdqueue.cpp index b8c67763d10..06a156edca6 100644 --- a/roxie/ccd/ccdqueue.cpp +++ b/roxie/ccd/ccdqueue.cpp @@ -1004,7 +1004,7 @@ static MapXToMyClass 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); @@ -2706,7 +2706,7 @@ class RoxieSocketQueueManager : public RoxieReceiverBase #endif Owned 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) @@ -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); @@ -3947,21 +3947,29 @@ class PingTimer : public Thread unsigned headerLen; const RoxiePacketHeader *header = mr->getMessageHeader(headerLen); Owned 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) {