elijahbenizzy commented on PR #778: URL: https://github.com/apache/burr/pull/778#issuecomment-4468065069
## Closing — fix is wrong as designed Investigating the failing \`test_end_to_end_parallel_collatz_many_unreliable_tasks\` revealed that this fix is fundamentally at odds with another required behavior. ### The conflict | Use case | What sub-app IDs need | |---|---| | **#761** (two successful invocations of the parallel action within one parent app's lifetime) | IDs must **differ** so each invocation runs fresh | | **\`test_end_to_end_parallel_collatz_many_unreliable_tasks\`** (parent app fails mid-parallel-action, gets rebuilt + resumed via \`initialize_from\`, sub-tasks resume from their checkpoints) | IDs must **stay stable** across parent rebuilds so the cascading initializer can find prior sub-app state | ### What I confirmed via diagnostics - Original (unsalted) sub-app IDs are stable across parent retries: e.g. \`91e33a489b3c3b430d6d66c4...\` is the same in iteration 1, 2, 3 of a parent rebuild loop. - \`context.sequence_id\` **increments on every parent attempt**, including resume rebuilds: 1 → 2 → 3 across retries. - \`state.__SEQUENCE_ID\` does the same: 1 → 2 → 3 across retries (and notably \`__PRIOR_STEP\` is dropped from state on the resumed iterations, suggesting \`initialize_from\` does some bookkeeping that bumps the counter). So salting with sequence_id fixes #761 but breaks the retry-on-failure resume path: each rebuild gets fresh sub-app IDs, the cascading initializer can't find prior sub-app state, sub-tasks restart from scratch — and because new failures keep occurring, the test loops forever. ### What would actually work A salt that: 1. Stays stable when the parallel action is being retried after a sub-action failure (so checkpoints work) 2. Differs between distinct successful invocations of the same parallel action within one parent app's lifetime (so #761 is fixed) No value in the current \`run_and_update\` context satisfies both. Candidates that would need new plumbing: - A counter of "successful prior completions of this parallel action" — would need to be persisted in parent state, incremented by the action's reduce step. Cleanest semantically; requires new field in state and modification to \`TaskBasedParallelAction\` execution flow. - User-provided per-invocation salt (opt-in via override): preserves default behavior, lets users hitting #761 fix their case explicitly. Punts the problem. - Default cascading initializer to \`None\` for sub-apps: large breaking change, would update \`test_end_to_end_parallel_collatz_many_unreliable_tasks\`. Possibly the "right" long-term answer but needs design discussion. This needs a design call before any fix lands. Closing the PR. Issue #761 stays open with the diagnostic findings. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
