-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Internal Code
-
Fully Compatible
-
ALL
-
Dev Tools 2018-12-03, Dev Tools 2018-12-17, Dev Tools 2018-12-31
-
0
BackgroundJob::jobBody() has this code:
try { run(); } catch (const std::exception& e) { error() << "backgroundjob " << threadName << " exception: " << redact(e.what()); throw; }
The problem with this is that the rethrow will always trigger std::terminate(), since there are no further exception handlers up the stack. The catch-and-rethrow here will make the resulting stack trace appear from the point of rethrow instead of at the point of the original throw, making the stack trace useless for debugging. If we removed this try/catch, the stack trace would become useful again. Note that our terminate handler already successfully logs e.what(), so no functionality will be lost.