mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-21 00:50:35 +00:00
commitlog: don't move pointer to segment
We are currently moving the pointer we acquired to the segment inside the lambda in which we'll handle the cycle. The problem is, we also use that same pointer inside the exception handler. If an exception happens we'll access it and we'll crash. Signed-off-by: Glauber Costa <glauber@scylladb.com> Message-Id: <20180518125820.10726-1-glauber@scylladb.com>
This commit is contained in:
committed by
Tomasz Grabiec
parent
684bb2042d
commit
596a525950
@@ -728,7 +728,7 @@ public:
|
||||
*/
|
||||
auto me = shared_from_this();
|
||||
auto fp = _file_pos;
|
||||
return _pending_ops.wait_for_pending(timeout).then([me = std::move(me), fp, timeout] {
|
||||
return _pending_ops.wait_for_pending(timeout).then([me, fp, timeout] {
|
||||
if (fp != me->_file_pos) {
|
||||
// some other request already wrote this buffer.
|
||||
// If so, wait for the operation at our intended file offset
|
||||
|
||||
Reference in New Issue
Block a user