File tree Expand file tree Collapse file tree
src/api/qpid-proton/reactor/handler Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -162,9 +162,18 @@ void TxReceiverHandler::on_session_transaction_error(session &s) {
162162
163163void TxReceiverHandler::on_session_transaction_aborted (session &s) {
164164 processed += current_batch;
165+
166+ logger (debug) << " [on_session_transaction_aborted] Transaction aborted, releasing unsettled deliveries" ;
167+ for (auto d : recv.unsettled_deliveries ()) {
168+ d.release ();
169+ }
170+
165171 current_batch = 0 ;
166172 logger (debug) << " [on_session_transaction_aborted] messages aborted, processed: " << processed;
167- if (count == 0 || processed < count) {
173+
174+ if (count == 0 ) {
175+ s.connection ().close ();
176+ } else if (processed < count) {
168177 logger (info) << " [on_session_transaction_aborted] re-declaring transaction" ;
169178 s.transaction_declare ();
170179 } else {
@@ -373,6 +382,7 @@ void TxReceiverHandler::on_message(delivery &d, message &m)
373382
374383 session s = d.session ();
375384 d.accept ();
385+
376386 current_batch += 1 ;
377387
378388 if (log_msgs == " dict" ) {
@@ -444,9 +454,6 @@ void TxReceiverHandler::on_message(delivery &d, message &m)
444454 s.transaction_commit ();
445455 } else if (tx_action == " rollback" ) {
446456 s.transaction_abort ();
447- if (count == 0 ) {
448- recv.connection ().close ();
449- }
450457 }
451458
452459 if (tx_action == " none" ) {
You can’t perform that action at this time.
0 commit comments