From b75719af1077bbc197eb953e092946154e65e812 Mon Sep 17 00:00:00 2001 From: Peyman Gardideh Date: Sun, 18 Aug 2024 20:08:17 -0700 Subject: [PATCH] Make sure to close publisher properly when GR is requested Summary: I missed this when implementing patch publisher. When we send a request for gr, we queue an empty patch chunk and let this check break out of the publish loop. Right now we end up waiting for this for ever and crash on warmboot exit Differential Revision: D61443485 Privacy Context Container: L1125642 fbshipit-source-id: 2297df95d13a2784cc42be2f54a0fc67a6917869 --- fboss/fsdb/client/FsdbPatchPublisher.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fboss/fsdb/client/FsdbPatchPublisher.cpp b/fboss/fsdb/client/FsdbPatchPublisher.cpp index 976071542f9af..c40a0c593bbe1 100644 --- a/fboss/fsdb/client/FsdbPatchPublisher.cpp +++ b/fboss/fsdb/client/FsdbPatchPublisher.cpp @@ -43,6 +43,12 @@ folly::coro::Task FsdbPatchPublisher::serveStream(StreamT&& stream) { XLOG(DBG2) << " Detected cancellation"; break; } + if (isGracefulServiceLoopCompletionRequested()) { + XLOG(ERR) << "Detected GR cancellation"; + throw FsdbClientGRDisconnectException( + "DeltaPublisher disconnectReason: GR"); + break; + } PublisherMessage message; message.set_patch(std::move(*patch)); co_yield std::move(message);