File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -587,6 +587,11 @@ void client::rollback_transaction()
587587 size_t log_size;
588588 s_log.truncate_seal_and_close (fd_log, log_size);
589589
590+ // We now own destruction of fd_log.
591+ auto cleanup_fd_log = make_scope_guard ([&]() {
592+ close_fd (fd_log);
593+ });
594+
590595 // Avoid sending transaction log fd to the server read only transactions.
591596 if (log_size > 0 )
592597 {
@@ -623,6 +628,11 @@ void client::commit_transaction()
623628 size_t log_size;
624629 s_log.truncate_seal_and_close (fd_log, log_size);
625630
631+ // We now own destruction of fd_log.
632+ auto cleanup_fd_log = make_scope_guard ([&]() {
633+ close_fd (fd_log);
634+ });
635+
626636 // Send the server the commit event with the log segment fd.
627637 FlatBufferBuilder builder;
628638 build_client_request (builder, session_event_t ::COMMIT_TXN);
You can’t perform that action at this time.
0 commit comments