Prevent panic when retry attempt value in map task gets larger than bitarray was allocated for#6802
Merged
Sovietaced merged 3 commits intomasterfrom Feb 10, 2026
Merged
Conversation
…itarray was allocated for Signed-off-by: Fabio Grätz <fabio@cusp.ai>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6802 +/- ##
==========================================
+ Coverage 56.95% 56.96% +0.01%
==========================================
Files 929 929
Lines 58152 58156 +4
==========================================
+ Hits 33121 33131 +10
+ Misses 21989 21983 -6
Partials 3042 3042
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sovietaced
previously approved these changes
Dec 15, 2025
Member
Sovietaced
left a comment
There was a problem hiding this comment.
Is unit test coverage possible?
pingsutw
previously approved these changes
Dec 16, 2025
Member
Author
|
I'll try to add a unit test let's not merge yet. |
Signed-off-by: Fabio Grätz <fabio@cusp.ai>
Member
Author
@Sovietaced I added a unit test that follows the pattern of |
Sovietaced
approved these changes
Feb 10, 2026
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.
Why are the changes needed?
With a default configuration of
max-node-retries-system-failures=3anddefault-max-attempts=1, the following workflow leads to a panic in the node array handler:The panic occurs here when validating whether the current value of attempts can be tracked in a bitarray that was allocated for this purpose.
The following goes wrong:
Currently the
retries=8set on the task decorator is not taken into account when determining the max value of the number of attempts: Here in the array node handler, for the example workflow above,nCtx.Node().GetRetryStrategy()isnil.maxAttemptsValueis thereforemax-node-retries-system-failures=3+default-max-attempts=1equals tomaxAttemptsValue=4. When creating the bit array to track the retry attempts here, it is determined that 3 bits are needed to store values that cannot be higher than 4.However, the task is actually retried 8 times. Up to attempt 7 this still works because only 3 bits are needed. But attempt 8 then panics here.
What changes were proposed in this pull request?
When determining the max value that can be stored in the bit array, we need to account not only for
nCtx.Node().GetRetryStrategy()but also fornCtx.Node().GetArrayNode().GetSubNodeSpec().GetRetryStrategy()which does contain the desiredretries=8.During my debugging,
nCtx.Node().GetRetryStrategy()was actually alwaysnilbut I cannot say for sure this is always the case. So I propose to allocate the bit array to have space for the max of both values to be on the safe side.How was this patch tested?
The example above panics on latest master but works with the changes in this PR.
Check all the applicable boxes
Summary by Bito