@@ -406,10 +406,20 @@ void StfSenderOutput::sendStfToTfBuilder(const std::uint64_t pStfId, const std::
406406 assert (!pTfBuilderId.empty ());
407407 std::scoped_lock lLock (mScheduledStfMapLock );
408408
409+ { // Check if we handled this grpc call before, and we are handling a retry now
410+ const auto lResIter = mSchedulingResult .find (pTfBuilderId);
411+ if (lResIter != mSchedulingResult .end ()) {
412+
413+ if (lResIter->second .first == pStfId) {
414+ pRes.set_status (lResIter->second .second );
415+ return ;
416+ }
417+ }
418+ }
419+
409420 const auto lStfIter = mScheduledStfMap .find (pStfId);
410421 // verify we have the STF.
411422 if (lStfIter == mScheduledStfMap .end ()) {
412-
413423 if (pTfBuilderId != " -1" ) {
414424 // request for Stf we don't have is an error
415425 pRes.set_status (StfDataResponse::DATA_DROPPED_UNKNOWN);
@@ -442,21 +452,23 @@ void StfSenderOutput::sendStfToTfBuilder(const std::uint64_t pStfId, const std::
442452 } else if (mOutputFairMQ ) {
443453 lOk = mOutputFairMQ ->sendStfToTfBuilder (pTfBuilderId, std::move (lStf));
444454 }
445- if (!lOk) {
446- pRes.set_status (StfDataResponse::TF_BUILDER_UNKNOWN);
447- mDropQueue .push (std::move (lStf));
448- EDDLOG_GRL (1000 , " sendStfToTfBuilder: TfBuilder not known to StfSender. tfb_id={}" , pTfBuilderId);
449- return ;
450- }
451-
452- // update status and counters
453- pRes.set_status (StfDataResponse::OK);
454- {
455+ if (lOk) {
456+ // update status and counters
457+ pRes.set_status (StfDataResponse::OK);
455458 std::scoped_lock lCntLock (mCounters .mCountersLock );
456459 mCounters .mValues .mInSending .mSize += lStfSize;
457460 mCounters .mValues .mInSending .mCnt += 1 ;
461+ } else {
462+ pRes.set_status (StfDataResponse::TF_BUILDER_UNKNOWN);
463+ mDropQueue .push (std::move (lStf));
464+ EDDLOG_GRL (1000 , " sendStfToTfBuilder: TfBuilder not known to StfSender. tfb_id={}" , pTfBuilderId);
458465 }
459466 }
467+
468+ // remember the result for the stf
469+ auto &lResultInfo = mSchedulingResult [pTfBuilderId];
470+ lResultInfo.first = pStfId;
471+ lResultInfo.second = pRes.status ();
460472}
461473
462474// / Drop thread
0 commit comments