Skip to content

Commit 67126a9

Browse files
committed
fix: reset FDv1 fallback retry source between schedules
1 parent 9a93aab commit 67126a9

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

libs/server-sdk/src/data_systems/fdv2/fdv2_data_system.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,11 @@ void FDv2DataSystem::ScheduleFDv2RetryLocked(std::chrono::seconds ttl) {
433433
if (ttl == std::chrono::seconds::zero()) {
434434
return;
435435
}
436+
// Cancel any in-flight retry and start fresh; CancellationSource is
437+
// one-shot, so reusing the same source for successive schedules would
438+
// leak prior timers.
439+
fdv1_fallback_retry_cancel_.Cancel();
440+
fdv1_fallback_retry_cancel_ = async::CancellationSource{};
436441
LD_LOG(logger_, LogLevel::kInfo)
437442
<< Identity() << ": FDv2 retry scheduled in " << ttl.count() << "s";
438443
async::Delay(ioc_, ttl, fdv1_fallback_retry_cancel_.GetToken())

0 commit comments

Comments
 (0)