You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reuse UDP sender channels between messages - #1088
reuse UDP sender channels between messages instead of disconnecting after every send
apply the documented keepAliveCount and keepAliveTime limits to UDP senders
add focused regression coverage and remove the completed TODO item
Rationale
UDP senders are retained in the sender map, but AbstractSender.keepalive() currently closes their datagram channels after every message. Applying the existing keepalive policies avoids repeated channel creation while preserving configurable lifecycle bounds.
Validation
ant test -Dtest.entry=org.apache.catalina.tribes.transport.TestAbstractSenderKeepAlive — 2 tests, 0 failures, 0 errors, 0 skipped
ant validate — passed
ant clean deploy — passed
complete unfiltered ant clean test on Linux/OpenSSL — 42,214 tests across 743 suites, 0 failures, 0 errors, 362 environment-dependent skips
generated distribution start, root HTTP request returned 200, and clean stop — passed
The complete macOS run reached the end but the two OpenSSL cipher suites failed because /usr/bin/openssl is LibreSSL 3.3.6. The same unfiltered suite passed in Linux with OpenSSL.
@rmaucher, could you review the UDP sender reuse change? You authored the latest direct AbstractSender update. @markt-asf, your review would also be valuable given your recent clustering and sender work in the same file.
This introduces a regression when switching from UDP to TCP for the same cluster member. ParallelNioSender reuses the same NioSender, but after a UDP send the channel remains connected. A subsequent TCP send fails with a NullPointerException because socketChannel is null.
I reproduced this with running Tomcat instances. All three UDP-to-TCP transitions succeeded on main, but failed with this change.
There also appears to be a resource leak: the UDP socket remains open after tomcat.stop().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
keepAliveCountandkeepAliveTimelimits to UDP sendersRationale
UDP senders are retained in the sender map, but
AbstractSender.keepalive()currently closes their datagram channels after every message. Applying the existing keepalive policies avoids repeated channel creation while preserving configurable lifecycle bounds.Validation
ant test -Dtest.entry=org.apache.catalina.tribes.transport.TestAbstractSenderKeepAlive— 2 tests, 0 failures, 0 errors, 0 skippedant validate— passedant clean deploy— passedant clean teston Linux/OpenSSL — 42,214 tests across 743 suites, 0 failures, 0 errors, 362 environment-dependent skipsThe complete macOS run reached the end but the two OpenSSL cipher suites failed because
/usr/bin/opensslis LibreSSL 3.3.6. The same unfiltered suite passed in Linux with OpenSSL.