elijahbenizzy commented on issue #761:
URL: https://github.com/apache/burr/issues/761#issuecomment-4468066447

   ## Update — initial fix attempt was wrong
   
   Tried the obvious fix in #778 (salt sub-app IDs with \`context.sequence_id\` 
inside \`TaskBasedParallelAction.run_and_update\`) and it works for the case 
you reported. Unfortunately it also **breaks** 
\`tests/test_end_to_end.py::test_end_to_end_parallel_collatz_many_unreliable_tasks\`,
 which exercises the opposite use case: parent app fails mid-parallel-action, 
gets rebuilt via \`initialize_from\`, sub-tasks should resume from their 
per-sub-app checkpoints.
   
   That test passes today (with the bug) because the 
deterministic-by-(parent_id, i, j) sub-app IDs are stable across parent 
rebuilds, so the cascading initializer can find prior sub-app state. Salting 
with sequence_id breaks that: \`sequence_id\` increments on every parent 
attempt — including resume rebuilds — so each retry generates fresh sub-app 
IDs, the initializer can't find prior state, and sub-tasks restart from scratch 
in an infinite loop.
   
   ### So the core problem is wider than it looked
   
   Cascading the parent's state_initializer down to sub-apps serves two 
purposes that are now in tension:
   
   1. **Resume sub-task progress after a parent crash** 
(\`test_end_to_end_parallel_collatz_many_unreliable_tasks\` depends on this)
   2. **Reload "expected" sub-app state** (which causes the bug you reported — 
second invocation gets first invocation's state)
   
   No salt computable from current \`run_and_update\` context can satisfy both. 
We need either:
   
   - A persisted counter of "prior successful completions of this parallel 
action" (then salt with that). Requires new state machinery.
   - A user-provided per-invocation discriminator (opt-in override on 
\`TaskBasedParallelAction\`). Preserves current default; punts to users.
   - Default cascading initializer to \`None\` for sub-apps. Would break the 
retry-on-failure pattern as currently written; needs design discussion.
   
   The workaround you posted (override \`tasks()\` to mix 
\`context.sequence_id\` into \`task.application_id\`) is still the right hack 
for your specific case — just be aware that if you also rely on sub-app 
checkpoint resumption across parent rebuilds, you'd hit the same conflict.
   
   This is going to need a design conversation among the maintainers before we 
ship a fix. Apologies for the spin-up + spin-down; the diagnostic work in #778 
should at least make the path forward clearer.


-- 
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]

Reply via email to