Skip to content

Commit 67719f6

Browse files
Chandhana Solainathanmeta-codesync[bot]
authored andcommitted
telemetry: Add structured error logging to takeover receive path
Summary: Adds structured error logging for the takeover receive side (receiving data from the previous daemon and remounting), so these failures surface in perfpipe_edenfs_errors Reviewed By: genevievehelsel Differential Revision: D108648978 fbshipit-source-id: 4108a985cdeab84260d4561c4adcd1f2d4d68517
1 parent 23fddd5 commit 67719f6

1 file changed

Lines changed: 25 additions & 5 deletions

File tree

eden/fs/service/EdenServer.cpp

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,10 +1488,20 @@ Future<Unit> EdenServer::prepareImpl(std::shared_ptr<StartupLogger> logger) {
14881488
&TakeoverStats::receive, takeoverReceiveWatch.elapsed());
14891489
};
14901490
auto edenConfig = serverState_->getEdenConfig();
1491-
takeoverData = takeoverMounts(
1492-
takeoverPath,
1493-
getTakeoverTimeoutSeconds(*edenConfig),
1494-
shouldThrowDuringTakeover(*edenConfig));
1491+
try {
1492+
takeoverData = takeoverMounts(
1493+
takeoverPath,
1494+
getTakeoverTimeoutSeconds(*edenConfig),
1495+
shouldThrowDuringTakeover(*edenConfig));
1496+
} catch (...) {
1497+
auto ew = folly::exception_wrapper{std::current_exception()};
1498+
ew.with_exception([&](const std::exception& ex) {
1499+
serverState_->getErrorLogger().log(
1500+
EdenErrorInfo::takeover(ErrorArg::fromExceptionWithoutTrace(ex))
1501+
.withErrorType("takeover_receive_failed"));
1502+
});
1503+
ew.throw_exception();
1504+
}
14951505
serverState_->getStats()->increment(&TakeoverStats::receiveSuccess);
14961506
logger->log(
14971507
"Received takeover information for ",
@@ -1630,7 +1640,9 @@ std::vector<ImmediateFuture<Unit>> EdenServer::prepareMountsTakeover(
16301640
std::move(initialConfig), false, [](auto) {}, std::move(info));
16311641
})
16321642
.thenTry(
1633-
[logger, mountPath = info.mountPath](
1643+
[logger,
1644+
serverState = serverState_,
1645+
mountPath = info.mountPath](
16341646
folly::Try<std::shared_ptr<EdenMount>>&& result)
16351647
-> ImmediateFuture<folly::Unit> {
16361648
if (result.hasValue()) {
@@ -1643,6 +1655,14 @@ std::vector<ImmediateFuture<Unit>> EdenServer::prepareMountsTakeover(
16431655
mountPath,
16441656
": ",
16451657
result.exception().what());
1658+
result.exception().with_exception(
1659+
[&](const std::exception& ex) {
1660+
serverState->getErrorLogger().log(
1661+
EdenErrorInfo::takeover(
1662+
ErrorArg::fromExceptionWithoutTrace(ex))
1663+
.withMountPoint(mountPath.asString())
1664+
.withErrorType("takeover_remount_failed"));
1665+
});
16461666
return makeImmediateFuture<Unit>(
16471667
std::move(result).exception());
16481668
}

0 commit comments

Comments
 (0)