-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Return failure traces when running with amqp_trx_plugin #9872
Conversation
@@ -491,7 +491,8 @@ class producer_plugin_impl : public std::enable_shared_from_this<producer_plugin | |||
bool process_incoming_transaction_async(const transaction_metadata_ptr& trx, | |||
bool persist_until_expired, | |||
next_function<transaction_trace_ptr> next, | |||
RetryLaterFunc retry_later) | |||
RetryLaterFunc retry_later, | |||
bool return_failure_trace = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems pretty fragile to me. I think you'd be better of making sure that all downstream consumers can handle a transaction trace with an exception appropriately, and never extract the exception here. Either that or somehow use types that enforce consistency between return_failure_trace and next.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now this will only be true for amqp_trx_plugin
. However, a new send_transaction2
in the future should also work this way (at least optionally). The community has requested this type of behavior.
…action_trace failures
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like that fixed the test failures.
Change Description
amqp_trx_plugin
Change Type
Select ONE:
Testing Changes
Select ANY that apply:
Consensus Changes
API Changes
Documentation Additions
Documentation Additions
When running with amqp_trx_plugin,
transaciton_trace
can be returned for partial executed transactions which includes the exception. It is up to the user to understand these traces as failure cases.