Avoid infinite loop in DeltaManager with invalid batch size - #1042
Merged
markt-asf merged 1 commit intoAug 18, 2026
Merged
Conversation
lihongyi87
force-pushed
the
fix-deltamanager-sendallsessionssize-loop
branch
4 times, most recently
from
August 14, 2026 05:48
a930578 to
2dc4e64
Compare
Contributor
|
I'd rather document that |
lihongyi87
force-pushed
the
fix-deltamanager-sendallsessionssize-loop
branch
from
August 14, 2026 13:34
2dc4e64 to
0297ebb
Compare
Contributor
Author
|
Thanks for the review. Reworked as suggested: the setter now rejects a non-positive |
markt-asf
reviewed
Aug 17, 2026
Comment on lines
+322
to
+328
| <fix> | ||
| Validate that the <code>DeltaManager</code> attribute | ||
| <code>sendAllSessionsSize</code> is a positive integer. Zero or | ||
| negative values previously caused an infinite loop or a | ||
| <code>NegativeArraySizeException</code> during session state transfer. | ||
| (lihongyi87) | ||
| </fix> |
Contributor
There was a problem hiding this comment.
This needs to be below the line since it will be back-ported.
Contributor
Author
There was a problem hiding this comment.
Moved below the line. Thanks for the pointer.
Reject a sendAllSessionsSize of zero or less with an IllegalArgumentException in the setter and document that the value must be a positive integer. Previously a non-positive value caused an infinite loop or a NegativeArraySizeException in the batching loop of handleGET_ALL_SESSIONS.
lihongyi87
force-pushed
the
fix-deltamanager-sendallsessionssize-loop
branch
from
August 18, 2026 01:37
0297ebb to
6344885
Compare
markt-asf
pushed a commit
that referenced
this pull request
Aug 18, 2026
Reject a sendAllSessionsSize of zero or less with an IllegalArgumentException in the setter and document that the value must be a positive integer. Previously a non-positive value caused an infinite loop or a NegativeArraySizeException in the batching loop of handleGET_ALL_SESSIONS. Clean-up by markt
markt-asf
pushed a commit
that referenced
this pull request
Aug 18, 2026
Reject a sendAllSessionsSize of zero or less with an IllegalArgumentException in the setter and document that the value must be a positive integer. Previously a non-positive value caused an infinite loop or a NegativeArraySizeException in the batching loop of handleGET_ALL_SESSIONS. Clean-up by markt
markt-asf
pushed a commit
that referenced
this pull request
Aug 18, 2026
Reject a sendAllSessionsSize of zero or less with an IllegalArgumentException in the setter and document that the value must be a positive integer. Previously a non-positive value caused an infinite loop or a NegativeArraySizeException in the batching loop of handleGET_ALL_SESSIONS. Clean-up by markt
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
When
sendAllSessionsisfalseandsendAllSessionsSizeis configured to zero or a negative value, the batch loop inhandleGET_ALL_SESSIONSnever terminates:sendAllSessionsSize == 0:inever advances, so the loop runs indefinitely, sending empty session arrays and sleeping on each iteration. This blocks the cluster receiver thread on the master node and preventsEVT_ALL_SESSION_TRANSFERCOMPLETEfrom ever being sent.sendAllSessionsSize < 0:idecreases, andnew Session[len]throwsNegativeArraySizeException.The
setSendAllSessionsSizesetter performs no validation, and the documentation (cluster-manager.xml) does not state a minimum value.Fix
When
sendAllSessionsSizeis not positive, fall back to sending all sessions in a single batch (the same behaviour assendAllSessions == true):This is a one-line change at the point of use, keeping the setter unmodified for consistency with the rest of
DeltaManager.