I am currently facing a parent-child pipeline lifecycle binding issue. When the parent pipeline reaches Stage 4, it triggers a child hardware flashing task. Sometimes, I need to cancel the parent pipeline.
However, if the parent pipeline is currently in Stage 4, I do not want it to be canceled, because the child flashing task triggered in Stage 4 is uninterruptible. The subsequent stages in my parent pipeline require the child task to complete and return a successful status before they can proceed. What would be a good approach to solve this problem?
I think the tricky part here is that cancelling the parent job and stopping the actual flashing operation really need to be treated as two different things.
Maybe the child flashing job should run independently, with its own lifecycle, while the parent waits for its result.
That way, cancelling the parent wouldn’t automatically kill a flash that’s already in progress.
One thing I’d be careful about, though, is what happens afterward. If the parent has been cancelled but the flash finishes successfully, you’d still need a reliable way to record that result and avoid starting another flash on the same device too early.
I’m curious whether your flashing hardware is already protected by some kind of device lock or queue?