Skip to content

Commit

Permalink
MB-44253: Remove try/catch from Executor*::runTask methods
Browse files Browse the repository at this point in the history
Slightly adapted Dave Rigby's patch:

commit 3d4519d
Author: Dave Rigby <[email protected]>
Date:   Thu Feb 11 14:01:47 2021 +0000

    MB-44253: Remove try/catch from Executor*::runTask methods

    These try/catch blocks prevent unhandled exceptions in GlobalTasks
    from triggering std::terminate, and in turn generating a Breakpad
    minidump with the state of the process when the exception was thrown
    (as opposed to where it was caught).

    Started a discussion with Folly about a more generic way to address
    this (i.e. making the try/catch somehow optional) - see
    facebook#1525 - but in the short-term
    simply remove the invokeCatchingExns() wrapper from our branch.

    (Note: Currently we only use ThreadPoolExecutor and hence we only
    /need/ to change that one, but for consistency / possible future use
    change all instances).
  • Loading branch information
trondn committed Dec 3, 2024
1 parent 87a0028 commit 3df85fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions folly/Executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,11 @@ class Executor {

template <typename F>
FOLLY_ERASE static void invokeCatchingExns(char const* p, F f) noexcept {
#if 0
catch_exception(f, invokeCatchingExnsLog, p);
#else
f();
#endif
}

protected:
Expand Down

0 comments on commit 3df85fa

Please sign in to comment.