This is an automated email from the ASF dual-hosted git repository. rmaucher pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit bb2e2327d4294abfc05e22ce47cdf19451bace87 Author: opencode <[email protected]> AuthorDate: Fri Oct 9 16:21:51 2026 +0200 Document the required ordering of the two phase commit and fragmentation interceptors All fragments of a fragmented message share the unique id of the message, which is the only key the two phase commit interceptor correlates confirmations with. When the two phase commit interceptor is declared below the fragmentation interceptor it sees the fragments as separate messages with equal ids, keeps only one of them in its pending map and never completes the message. The working configuration, complete messages confirmed as one, requires the two phase commit interceptor to be declared before the fragmentation interceptor. Note the required declaration order in the javadoc of both interceptors. --- .../tribes/group/interceptors/FragmentationInterceptor.java | 4 ++++ .../tribes/group/interceptors/TwoPhaseCommitInterceptor.java | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/java/org/apache/catalina/tribes/group/interceptors/FragmentationInterceptor.java b/java/org/apache/catalina/tribes/group/interceptors/FragmentationInterceptor.java index 51d79a91ff..9f1ea5dd83 100644 --- a/java/org/apache/catalina/tribes/group/interceptors/FragmentationInterceptor.java +++ b/java/org/apache/catalina/tribes/group/interceptors/FragmentationInterceptor.java @@ -40,6 +40,10 @@ import org.apache.juli.logging.LogFactory; * rest to arrive <b>default=60,000ms -> 60seconds</b> This setting is useful to avoid OutOfMemoryErrors<br> * FragmentationInterceptor.maxSize=<max message size> - message size in bytes <b>default=1024*100 (around a tenth * of a MB)</b><br> + * When combined with the <code>TwoPhaseCommitInterceptor</code>, this interceptor must be declared after it in the + * channel configuration, so that the two-phase commit interceptor confirms complete messages and never individual + * fragments. All fragments of a message share its unique id, which the two-phase commit interceptor uses as its only + * correlation key. */ public class FragmentationInterceptor extends ChannelInterceptorBase implements FragmentationInterceptorMBean { /** diff --git a/java/org/apache/catalina/tribes/group/interceptors/TwoPhaseCommitInterceptor.java b/java/org/apache/catalina/tribes/group/interceptors/TwoPhaseCommitInterceptor.java index b349ba76c3..7f2e1cdf8c 100644 --- a/java/org/apache/catalina/tribes/group/interceptors/TwoPhaseCommitInterceptor.java +++ b/java/org/apache/catalina/tribes/group/interceptors/TwoPhaseCommitInterceptor.java @@ -37,7 +37,13 @@ import org.apache.juli.logging.LogFactory; * each message and only passes it on when the matching confirmation message is received. A confirmation that arrives * before its original message is remembered for the expiration time, so the original is still released when it * arrives late. There is no retransmission, so a message whose confirmation is lost is dropped after the expiration - * time. + * time. <br> + * <b>Configuration Options</b><br> + * When combined with the <code>FragmentationInterceptor</code>, this interceptor must be declared before it in the + * channel configuration, so that it confirms complete messages and never individual fragments. All fragments of a + * message share its unique id; if this interceptor is declared below the fragmentation interceptor, it sees the + * fragments as separate messages with equal ids, keeps only one of them in its pending map, and the large message is + * never delivered. */ public class TwoPhaseCommitInterceptor extends ChannelInterceptorBase { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
