Skip to content

Conversation

@clebertsuconic
Copy link
Contributor

logger.trace("AMQP Large Message Writer was closed before queued write attempt was executed");
return;
}
if (protonSender.getSession().getConnection().getRemoteState() != EndpointState.ACTIVE || protonSender.getSession().getConnection().getLocalState() != EndpointState.ACTIVE) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code actually already has several checks for closed state related to the sender but in reality even this is not a guarantee that you won't see this error as the proton code was not meant to be used outside the thread that manages the engine so the visibility of these values is not ensured to be updated in this delivering thread.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens is this:

We need to check the isClosed from the session / connection / link somehow. or we need to make the onRemoteClose to also close the Writer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just amended to another possible fix..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW: The thread being used here is the netty thread, as this is started with connection.runLater calls. so this is in the same thread.

@clebertsuconic clebertsuconic force-pushed the ARTEMIS-5890 branch 4 times, most recently from ba54e76 to c9adbf4 Compare February 3, 2026 23:47
@clebertsuconic clebertsuconic marked this pull request as draft February 3, 2026 23:53
@clebertsuconic
Copy link
Contributor Author

there are a few important comments added on https://issues.apache.org/jira/browse/ARTEMIS-5890

@tabish121
Copy link
Contributor

I've pushed a branch that simplifies the changes and accounts for the various paths that are triggering WARN logging which reduces the amount of change here. While the checks for the connection state were actually thread safe they don't account for all the ways this could hit closed states.

https://github.com/tabish121/artemis/pull/new/ARTEMIS-5890

Have a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants