Skip to content

Commit

Permalink
Remove redundant logging from CarbonRouterInstance deleter
Browse files Browse the repository at this point in the history
  • Loading branch information
mszabo-wikia committed Dec 16, 2024
1 parent 2bb88b8 commit cef7a2e
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions mcrouter/CarbonRouterInstance-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
#include <folly/io/async/EventBase.h>
#include <folly/json/DynamicConverter.h>

#ifndef MCROUTER_OSS_BUILD
#include <common/logging/logging.h>
#endif

#include "mcrouter/AsyncWriter.h"
#include "mcrouter/CarbonRouterInstanceBase.h"
#include "mcrouter/ExecutorObserver.h"
Expand Down Expand Up @@ -131,15 +127,8 @@ CarbonRouterInstance<RouterInfo>* CarbonRouterInstance<RouterInfo>::createRaw(
initFailureLogger();
}

// Deleter is only called if unique_ptr::get() returns non-null.
auto deleter = [](CarbonRouterInstance<RouterInfo>* inst) {
#ifdef MCROUTER_OSS_BUILD
FB_LOG_EVERY_MS(WARNING, 10000) << "Destroying CarbonRouterInstance";
#else
LOG_EVERY_MS(WARNING, 10000) << "Destroying CarbonRouterInstance";
#endif
delete inst;
};
// Custom deleter since ~CarbonRouterInstance() is private.
auto deleter = [](CarbonRouterInstance<RouterInfo>* inst) { delete inst; };
auto router =
std::unique_ptr<CarbonRouterInstance<RouterInfo>, decltype(deleter)>(
new CarbonRouterInstance<RouterInfo>(std::move(input_options)),
Expand Down

0 comments on commit cef7a2e

Please sign in to comment.