[
https://issues.apache.org/jira/browse/ARTEMIS-3240?focusedWorklogId=583585&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-583585
]
ASF GitHub Bot logged work on ARTEMIS-3240:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 15/Apr/21 17:06
Start Date: 15/Apr/21 17:06
Worklog Time Spent: 10m
Work Description: clebertsuconic commented on a change in pull request
#3541:
URL: https://github.com/apache/activemq-artemis/pull/3541#discussion_r614247595
##########
File path:
artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
##########
@@ -698,6 +700,21 @@ public void fail(ActiveMQException me, String message) {
shutdown(true);
}
+ private void returnReferencesFromAnyPendingLocalTransactions() {
+ for (Transaction tx : txMap.values()) {
+ final AMQSession amqSession = (AMQSession) tx.getProtocolData();
+ if (amqSession != null) {
+ amqSession.getCoreSession().resetTX(tx);
+ try {
+ commandProcessorInstance.returnReferences(tx, amqSession);
Review comment:
this whole code here could be simply. I tested locally here and it
worked.
```java
private void returnReferencesFromAnyPendingLocalTransactions() {
for (Transaction tx : txMap.values()) {
try {
tx.rollback();
} catch (Exception e) {
logger.warn(e.getMessage());
}
}
}
```
I don't know the reason for for returnReferences command? I think it's
because open wire can redeliver messages locally without a roundtrip to the
server, hence you need to make a distinction.
but on this case, a simple rollback on the transaction would suffice.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 583585)
Time Spent: 50m (was: 40m)
> Openwire nonBlockingRedelivery to true doesn't rollback the messages if the
> consumer is killed mid processing.
> --------------------------------------------------------------------------------------------------------------
>
> Key: ARTEMIS-3240
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3240
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: OpenWire
> Affects Versions: 2.17.0
> Reporter: Gary Tully
> Assignee: Gary Tully
> Priority: Major
> Fix For: 2.18.0
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> A message can be left in limbo of the ack is received before a failure of the
> connection. the ref has been removed from the consumer delivered list and
> rollback has no work to do. The normal openwire rollback processing that
> repopulates that list is missing in the failure case.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)