Skip to content

[AMQ-9569][#1882] SSL handshake write timeout enforcement#1883

Merged
cshannon merged 2 commits intoapache:mainfrom
jeanouii:fix/amq-9569-ssl-handshake-write-timeout
Apr 9, 2026
Merged

[AMQ-9569][#1882] SSL handshake write timeout enforcement#1883
cshannon merged 2 commits intoapache:mainfrom
jeanouii:fix/amq-9569-ssl-handshake-write-timeout

Conversation

@jeanouii
Copy link
Copy Markdown
Contributor

@jeanouii jeanouii commented Apr 8, 2026

Closes #1882

jeanouii added 2 commits April 7, 2026 17:57
…ces the bug: it blocks for 20+ seconds proving WriteTimeoutFilter.start() does not enforce soWriteTimeout.
…te/deRegisterWrite around super.start()

Adding a null check in the TimeoutThread is required to avoid random NPE if the TimeoutThread kicks in after the registerWrite but before initializeStreams() is called resulting in a NPE because TcpTransport.buffOut is null.
@jeanouii jeanouii self-assigned this Apr 8, 2026
@cshannon cshannon self-requested a review April 8, 2026 13:16
Copy link
Copy Markdown
Contributor

@cshannon cshannon left a comment

Choose a reason for hiding this comment

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

LGTM, nice fix and test!

The null check was a good catch as well, I was thinking through if we would ever get to a point where the streams are never initialized due to an error leading to the deregistration never happening, but that should not happen because any exception during start will trigger a close of the socket as well (i tested this)

@cshannon cshannon merged commit 2fee158 into apache:main Apr 9, 2026
19 of 20 checks passed
cshannon pushed a commit to cshannon/activemq that referenced this pull request Apr 9, 2026
…he#1883)

* feat(AMQ-9559)/feat(apache#1882): The failover test correctly reproduces the bug: it blocks for 20+ seconds proving WriteTimeoutFilter.start() does not enforce soWriteTimeout.

* feat(AMQ-9559)/feat(apache#1882): Similar to oneway() add registerWrite/deRegisterWrite around super.start()

Adding a null check in the TimeoutThread is required to avoid random NPE if the TimeoutThread kicks in after the registerWrite but before initializeStreams() is called resulting in a NPE because TcpTransport.buffOut is null.

(cherry picked from commit 2fee158)
cshannon pushed a commit to cshannon/activemq that referenced this pull request Apr 9, 2026
…he#1883)

* feat(AMQ-9559)/feat(apache#1882): The failover test correctly reproduces the bug: it blocks for 20+ seconds proving WriteTimeoutFilter.start() does not enforce soWriteTimeout.

* feat(AMQ-9559)/feat(apache#1882): Similar to oneway() add registerWrite/deRegisterWrite around super.start()

Adding a null check in the TimeoutThread is required to avoid random NPE if the TimeoutThread kicks in after the registerWrite but before initializeStreams() is called resulting in a NPE because TcpTransport.buffOut is null.

(cherry picked from commit 2fee158)
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.

[AMQ-9569] WriteTimeoutFilter does not timeout SSL write (handshake)

2 participants