fix(propeller): clamp ArrayNode subNode delta timestamps instead of panicking - #27
Open
pfernandes21 wants to merge 1 commit into
Open
pfernandes21 wants to merge 1 commit into
pfernandes21 wants to merge 1 commit into
Conversation
…anicking SubNodeDeltaTimestamps is a CompactArray sized from array-node.max-delta-timestamp (default 3d). A subNode that starts later than that (map task queued behind cluster capacity for days) produced a value too large for the slot and CompactArray.SetItem panicked, failing every round for that workflow (FlytePropellerPanic on delphi-production 2026-08-29 and 2026-09-04, value 262374s vs max 259200s). Saturate the stored offset at the array's MaxValue (and map negative offsets to 0) so the round completes; the subNode's reconstructed start time loses precision and a warning is logged when clamping occurs. Assisted-by: Devin:claude-opus-4.6
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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?
FlytePropellerPanicon delphi-production (2026-08-29, recurred 2026-09-04) is aCompactArrayinvariant violation in the ArrayNode handler:0x400e6= 262 374 s.SubNodeDeltaTimestampsis sized fromarray-node.max-delta-timestamp(default 3d = 259 200 s), so a map-task subNode that only got scheduled ~3d 53m after its ArrayNode started (the flytesnacks-staging queue has been GPU/CPU-bound for days) produced an offset that does not fit the slot.SetItempanics, the round'srecover()counts it asPanicObserved, and the workflow fails every subsequent round — the panic is deterministic for that state, so the execution never progresses.What changes were proposed in this pull request?
bitarray.CompactArray.MaxValue()— exposes the per-slot ceilingvalidateValuealready computes.array.clampedDeltaSeconds(delta, maxDelta)— pure helper: negative → 0 (unset), otherwisemin(seconds, maxDelta).arrayNodeHandler.Handlestores the clamped value and logs a warning when clamping occurs. The only effect of clamping is that the subNode's reconstructedstartedAt(used for event timestamps) saturates atmax-delta-timestampinstead of failing the round.The previous
uint64(negativeDuration.Seconds())also wrapped to ~2^64 and would have panicked the same way if an ArrayNode'sLastAttemptStartedAtever moved past a subNode's; the helper handles that case too.How was this patch tested?
Added
TestClampedDeltaSeconds(negative, zero, sub-second, in-range, at-max, and the production value 262374 s) andTestCompactArray_MaxValue.Labels
fixed
Check all the applicable boxes
Link to Devin session: https://app.devin.ai/sessions/246008e5dbb94b2fa6f80f272412b704
Open in Devin Desktop: https://app.devin.ai/desktop/session/246008e5dbb94b2fa6f80f272412b704?variant=devin
Requested by: @pfernandes21