summaryrefslogtreecommitdiffstats
path: root/src/common/async
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2021-08-04 14:58:11 +0200
committerIlya Dryomov <idryomov@gmail.com>2021-08-07 14:18:29 +0200
commitb2631ed3e3c4116e141dfb49f62a447e52632687 (patch)
tree3cc3326611f3ef5fb5a4f7d0832dd8f3b4cd1497 /src/common/async
parentMerge pull request #42149 from hualongfeng/fix_sync_point (diff)
downloadceph-b2631ed3e3c4116e141dfb49f62a447e52632687.tar.xz
ceph-b2631ed3e3c4116e141dfb49f62a447e52632687.zip
common/async: drop noexcept on io_context_pool threadfunc
This issue has been addressed in g++ 8: there is no try/catch in execute_native_thread_routine() anymore [1][2] and noexcept ends up having the opposite effect. Whereas without noexcept g++ guarantees that the stack would not be unwound [3], it doesn't make such guarantee for the noexcept case. According to the standard, these cases are distinct and even though both are implementation defined, g++ only defines the former. With noexcept, it unwinds up to the noexcept frame which is not useful at all. (clang unwinds up to and including the noexcept frame and only msvc does the right thing and immediately terminates.) [1] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=754d67d5ba4a1f9994210d402893a4cf49ce6a71 [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55917 [3] https://gcc.gnu.org/onlinedocs/gcc/Exception-handling.html Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'src/common/async')
-rw-r--r--src/common/async/context_pool.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/common/async/context_pool.h b/src/common/async/context_pool.h
index 992b3eccb0a..9c6cab7677d 100644
--- a/src/common/async/context_pool.h
+++ b/src/common/async/context_pool.h
@@ -58,13 +58,8 @@ public:
guard.emplace(boost::asio::make_work_guard(ioctx));
ioctx.restart();
for (std::int16_t i = 0; i < threadcnt; ++i) {
- // Mark this function as noexcept so any uncaught exceptions
- // call terminate at point of throw. Otherwise, under
- // libstdc++, they get caught by the thread cancellation
- // infrastructure, unwinding the stack and making debugging
- // much more difficult.
threadvec.emplace_back(make_named_thread("io_context_pool",
- [this]() noexcept {
+ [this]() {
ioctx.run();
}));
}