Skip to content

CXXCBC-194 ExtThreadSafe followup #376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions core/transactions/attempt_context_impl.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,23 @@ class attempt_context_impl
existing_error();
return func();
} catch (const async_operation_conflict& e) {
// can't do anything here but log and eat it.
CB_ATTEMPT_CTX_LOG_ERROR(this, "Attempted to perform txn operation after commit/rollback started: {}", e.what());
// you cannot call op_completed_with_error, as it tries to decrement
// the op count, however it didn't successfully increment it, so...
op_completed_with_error_no_cache(std::move(cb), std::current_exception());
auto err = transaction_operation_failed(FAIL_OTHER, "async operation conflict");
switch (state()) {
case attempt_state::ABORTED:
case attempt_state::ROLLED_BACK:
err.cause(TRANSACTION_ALREADY_ABORTED);
break;
case attempt_state::COMMITTED:
case attempt_state::COMPLETED:
err.cause(TRANSACTION_ALREADY_COMMITTED);
break;
default:
err.cause(UNKNOWN);
}
op_completed_with_error_no_cache(std::move(cb), std::make_exception_ptr(err));
} catch (const transaction_operation_failed& e) {
// thrown only from call_func when previous error exists, so eat it, unless
// it has PREVIOUS_OP_FAILED cause
Expand Down