Skip to content

Commit

Permalink
Revert "MB-43373: Abort memcached if exception thrown from GlobalTask…
Browse files Browse the repository at this point in the history
…::run v2"

Now FollyExecutorPool no longer catches exceptions on bg threads (see
MB-44253), we don't want to catch them ourselves in GlobalTask - we
want them to be uncaught and trigger std::terminate with a full
backtrace to where the exception was thrown from.

(Note: This was partially reverted by 8828aa7 ("Revert "MB-43818:
GlobalTask::execute: Log task info if exception thrown"), but the
throw was not removed. This patch completes the revert.

This reverts commit b6ed8d0.

Change-Id: I4b4085ee4b4eae3e397d79ade51cb3fc88f67e87
Reviewed-on: http://review.couchbase.org/c/kv_engine/+/147330
Reviewed-by: James Harrison <james.harrison@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
  • Loading branch information
daverigby committed Mar 1, 2021
1 parent a7c1730 commit 71df35f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
9 changes: 2 additions & 7 deletions engines/ep/src/globaltask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,8 @@ GlobalTask::~GlobalTask() {

bool GlobalTask::execute() {
// Invoke run with the engine as the target for alloc/dalloc
try {
BucketAllocationGuard guard(engine);
return run();
} catch (...) {
// Our terminate handler will print details of the exception.
std::terminate();
}
BucketAllocationGuard guard(engine);
return run();
}

void GlobalTask::snooze(const double secs) {
Expand Down
6 changes: 0 additions & 6 deletions engines/ep/src/globaltask.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,6 @@ class GlobalTask {
* how long to sleep before it should be scheduled again.
* If the task is complete (and should never be run again), return false.
*
* This method should not throw any (uncaught) exceptions - if it did then
* the task is potentially in a undefined state and hence not possible to
* know if it should be re-scheduled or not. If any exceptions are thrown
* then the exception will be logged and the program will be terminated
* via std::terminate.
*
* @return Whether or not this task should be rescheduled
*/
virtual bool run() = 0;
Expand Down

0 comments on commit 71df35f

Please sign in to comment.