You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are implementing a time-bound transactional workflow using FlowProducer.
Job A (Child): "Start Task" (Runs at Start Time).
Job B (Parent): "End/Revert Task" (Runs at End Time, depends on Job A).
We use a Flow to ensure that Job B only executes if Job A completes successfully (failParentOnFailure: true). This is critical to prevent the "End Task" from running if the "Start Task" never happened.
The Problem
In our application, the End Time is mutable—users can extend or shorten the duration of the task. We need to reschedule Job B (the Parent) to a new delay time.
However, once the Flow is added, Job B immediately enters the waiting-children state found in the waiting-children set (zset), waiting for Job A to finish.
Limitation
Because Job B is in waiting-children and not in the delayed state:
job.changeDelay(newDelay) does not work (or throws unrelated errors) because the job is not in the delayed set.
We cannot easily move the job back to delayed with a new timestamp without breaking the Flow dependency or manually manipulating Redis keys, which is unsafe.
Current Workaround
We are forced to abandon FlowProducer and use two independent delayed jobs. This introduces a race condition: if Job A (Start) fails, Job B (End) still runs, leading to data inconsistency.
Feature Request / Question
Is there a supported way to update the "delay" (execution time) of a Parent job that is currently waiting for children? Conceptually, we want the Parent to wait for children AND wait for the specified delay, whichever finishes last (or simply update the scheduled time of the parent regardless of child state).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
We are implementing a time-bound transactional workflow using
FlowProducer.Start Time).End Time, depends on Job A).We use a Flow to ensure that Job B only executes if Job A completes successfully (
failParentOnFailure: true). This is critical to prevent the "End Task" from running if the "Start Task" never happened.The Problem
In our application, the
End Timeis mutable—users can extend or shorten the duration of the task. We need to reschedule Job B (the Parent) to a new delay time.However, once the Flow is added, Job B immediately enters the
waiting-childrenstate found in thewaiting-childrenset (zset), waiting for Job A to finish.Limitation
Because Job B is in
waiting-childrenand not in thedelayedstate:job.changeDelay(newDelay)does not work (or throws unrelated errors) because the job is not in thedelayedset.delayedwith a new timestamp without breaking the Flow dependency or manually manipulating Redis keys, which is unsafe.Current Workaround
We are forced to abandon
FlowProducerand use two independent delayed jobs. This introduces a race condition: if Job A (Start) fails, Job B (End) still runs, leading to data inconsistency.Feature Request / Question
Is there a supported way to update the "delay" (execution time) of a Parent job that is currently waiting for children? Conceptually, we want the Parent to wait for children AND wait for the specified delay, whichever finishes last (or simply update the scheduled time of the parent regardless of child state).
Beta Was this translation helpful? Give feedback.
All reactions