Merge pull request #38852 from adamemerson/wip-thou-shalt-not-unwind

Thou Shalt Not Unwind
This commit is contained in:
Harish Munjulur 2021-01-25 15:22:38 -08:00 committed by GitHub
commit 46dee40a29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 12 additions and 11 deletions

View File

@ -70,7 +70,7 @@ Thread::~Thread()
{
}
void *Thread::_entry_func(void *arg) {
void *Thread::_entry_func(void *arg) noexcept {
void *r = ((Thread*)arg)->entry_wrapper();
return r;
}

View File

@ -48,7 +48,7 @@ class Thread {
virtual void *entry() = 0;
private:
static void *_entry_func(void *arg);
static void *_entry_func(void *arg) noexcept;
public:
const pthread_t &get_thread_id() const;

View File

@ -628,7 +628,7 @@ private:
// (3) manages deleted connections
// (4) TODO reconnect on connection errors
// (5) TODO cleanup timedout callbacks
void run() {
void run() noexcept {
amqp_frame_t frame;
while (!stopped) {

View File

@ -953,11 +953,12 @@ int AsioFrontend::run()
work.emplace(boost::asio::make_work_guard(context));
for (int i = 0; i < thread_count; i++) {
threads.emplace_back([=] {
threads.emplace_back([=]() noexcept {
// request warnings on synchronous librados calls in this thread
is_asio_thread = true;
boost::system::error_code ec;
context.run(ec);
// Have uncaught exceptions kill the process and give a
// stacktrace, not be swallowed.
context.run();
});
}
return 0;

View File

@ -864,7 +864,7 @@ RGWDataChangesLog::~RGWDataChangesLog() {
}
}
void RGWDataChangesLog::renew_run() {
void RGWDataChangesLog::renew_run() noexcept {
for (;;) {
dout(2) << "RGWDataChangesLog::ChangesRenewThread: start" << dendl;
int r = renew_entries();

View File

@ -201,7 +201,7 @@ class RGWDataChangesLog {
ceph::mutex renew_lock = ceph::make_mutex("ChangesRenewThread::lock");
ceph::condition_variable renew_cond;
void renew_run();
void renew_run() noexcept;
void renew_stop();
std::thread renew_thread;

View File

@ -396,7 +396,7 @@ private:
// (3) manages deleted connections
// (4) TODO reconnect on connection errors
// (5) TODO cleanup timedout callbacks
void run() {
void run() noexcept {
while (!stopped) {
// publish all messages in the queue

View File

@ -483,7 +483,7 @@ public:
// start the worker threads to do the actual queue processing
const std::string WORKER_THREAD_NAME = "notif-worker";
for (auto worker_id = 0U; worker_id < worker_count; ++worker_id) {
workers.emplace_back([this]() { io_context.run(); });
workers.emplace_back([this]() noexcept { io_context.run(); });
const auto rc = ceph_pthread_setname(workers.back().native_handle(),
(WORKER_THREAD_NAME+std::to_string(worker_id)).c_str());
ceph_assert(rc == 0);

View File

@ -145,7 +145,7 @@ class RGWPeriodPusher::CRThread {
{
http.start();
// must spawn the CR thread after start
thread = std::thread([this] { coroutines.run(push_all.get()); });
thread = std::thread([this]() noexcept { coroutines.run(push_all.get()); });
}
~CRThread()
{