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 using FlowProducer to model a lifecycle with dependencies:
Child Job: "Activate Resource" (Scheduled for execution).
Parent Job: "Cleanup/Release Resource" (Waits for Child, ensuring cleanup happens after activation).
The Requirement
We often face a scenario where we need to cancel the "Activate" (Child) job (e.g., the user decides to cancel the scheduled activation) but we MUST keep the "Cleanup" (Parent) job scheduled or alive.
The Parent job acts as a fail-safe or finalizer that must eventually run to ensure the system returns to a consistent state (e.g., releasing locks), even if the specific Activation action was cancelled.
The Problem
Currently, managing the removal of a Child job within a Flow is all-or-nothing or undefined regarding the Parent's lifecycle. We lack an explicit API to say "Remove this Child, but detach it from the Parent and leave the Parent intact/waiting".
If we simply remove the Child job, the Parent (waiting in waiting-children state) is left depending on a job that no longer exists, which can lead to it being stuck or removed depending on internal behavior.
Proposed Solution
We propose adding an option to the removal API (e.g., job.remove() or queue.remove()) to explicitly control the impact on the parent flow structure.
// Proposed APIawaitjob.remove({removeChildren: false,// Existing (conceptual)removeParent: false// NEW: Explicitly prevent this removal from cascading to or corrupting the Parent});
This would allow us to surgically remove a Child job while preserving the Parent job (perhaps effectively marking the dependency as "resolved" or simply detached), ensuring our cleanup logic remains scheduled.
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.
-
Use Case
We are using
FlowProducerto model a lifecycle with dependencies:The Requirement
We often face a scenario where we need to cancel the "Activate" (Child) job (e.g., the user decides to cancel the scheduled activation) but we MUST keep the "Cleanup" (Parent) job scheduled or alive.
The Parent job acts as a fail-safe or finalizer that must eventually run to ensure the system returns to a consistent state (e.g., releasing locks), even if the specific Activation action was cancelled.
The Problem
Currently, managing the removal of a Child job within a Flow is all-or-nothing or undefined regarding the Parent's lifecycle. We lack an explicit API to say "Remove this Child, but detach it from the Parent and leave the Parent intact/waiting".
If we simply remove the Child job, the Parent (waiting in
waiting-childrenstate) is left depending on a job that no longer exists, which can lead to it being stuck or removed depending on internal behavior.Proposed Solution
We propose adding an option to the removal API (e.g.,
job.remove()orqueue.remove()) to explicitly control the impact on the parent flow structure.This would allow us to surgically remove a Child job while preserving the Parent job (perhaps effectively marking the dependency as "resolved" or simply detached), ensuring our cleanup logic remains scheduled.
Beta Was this translation helpful? Give feedback.
All reactions