Files
scylladb/utils
Tomasz Grabiec 57e25fa0f8 utils: phased_barrier: Make advance_and_await() have strong exception guarantees
Currently, when advance_and_await() fails to allocate the new gate
object, it will throw bad_alloc and leave the phased_barrier object in
an invalid state. Calling advance_and_await() again on it will result
in undefined behavior (typically SIGSEGV) beacuse _gate will be
disengaged.

One place affected by this is table::seal_active_memtable(), which
calls _flush_barrier.advance_and_await(). If this throws, subsequent
flush attempts will SIGSEGV.

This patch rearranges the code so that advance_and_await() has strong
exception guarantees.
Message-Id: <1542645562-20932-1-git-send-email-tgrabiec@scylladb.com>
2018-11-20 16:15:12 +00:00
..
2018-05-30 14:41:40 +02:00
2018-11-01 10:19:32 +02:00
2017-04-17 23:03:15 +03:00
2017-05-17 12:30:03 +03:00
2016-09-28 17:34:16 +03:00
2017-09-18 12:44:05 +02:00
2018-05-30 14:41:41 +02:00
2018-11-01 13:16:17 +00:00
2018-11-01 13:16:17 +00:00