[
https://issues.apache.org/jira/browse/ARTEMIS-4476?focusedWorklogId=887626&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-887626
]
ASF GitHub Bot logged work on ARTEMIS-4476:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 27/Oct/23 18:14
Start Date: 27/Oct/23 18:14
Worklog Time Spent: 10m
Work Description: clebertsuconic commented on code in PR #4656:
URL: https://github.com/apache/activemq-artemis/pull/4656#discussion_r1374903741
##########
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerSenderContext.java:
##########
@@ -980,6 +983,19 @@ class DefaultController implements SenderController {
@Override
public Consumer init(ProtonServerSenderContext senderContext) throws
Exception {
+ {
+ ProtonHandler handler;
+ Connection qpidConnection;
+ // Avoiding possible NPEs that could happen on mock tests
+ if (connection != null &&
+ (handler = connection.getHandler()) != null && (qpidConnection
= handler.getConnection()) != null) {
+ if (qpidConnection.getRemoteState() == EndpointState.CLOSED) {
+ logger.warn("AMQP Connection creating invalid consumer for
closed connection", connection);
+ throw new IllegalStateException("AMQP connection " +
connection.getRemoteAddress() + " creating invalid consumer for closed
connection");
+ }
+ }
+ }
+
Review Comment:
fair enough...
I"m in the process to making it ready to be merged now.. and I will cleanup
this before I set it ready to merge
Thanks for looking into it.
Issue Time Tracking
-------------------
Worklog Id: (was: 887626)
Time Spent: 0.5h (was: 20m)
> Connection Failure Race Conditions in AMQP and Core
> ---------------------------------------------------
>
> Key: ARTEMIS-4476
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4476
> Project: ActiveMQ Artemis
> Issue Type: Task
> Reporter: Clebert Suconic
> Assignee: Clebert Suconic
> Priority: Major
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Failure Detection has a possibility to a race condition with the processing
> of the client packets (or frames in the case of AMQP).
> This is because Netty detects the failure and removes the connection objects
> while the packets are still processing things.
> I was not able to reproduce this particular issue, but I have seen a case
> from a memory dump where the consumer was created while the connection was
> already dropped, leaving the consumer isolated without any communication with
> clients.
> That particular case I could see a possibility because of these races.
> I am adding tests to exercise connection failure in stress and I was able to
> reproduce other issues.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)