Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic cancellation of worker pipelines when an child or infant pipeline is cancelled #75

Open
NJLangley opened this issue Nov 11, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@NJLangley
Copy link
Contributor

When cancelling the parent or child pipelines (recursive cancel), the framework pipelines complete with a cancelled status, but the worker pipelines continue running (because cancelling does not allow cleanup). In the case where 50 workers in different data factories need cancelling too, this can be time consuming.

It would be nice if the framework had the option to define a cancellation policy, much like the continuation on error options, to allow cancellation of worker pipelines in the case an infant is cancelled.

I have been looking into pushing data factory events into event grid, to trigger a function for cancelled infants, that calls a new a cleanup pipeline to do just this. It cancels the worker, and waits for it to finish before updating the CurrentExecution table (only if required). I have PoC code that I can share.

@NJLangley NJLangley added the enhancement New feature or request label Nov 11, 2020
@mrpaulandrew
Copy link
Owner

@NJLangley sounds interesting.
Yes, would be interested to see it.

Or, what about if you request a cancellation by updating the CurrentExecution table yourself with a special status. 'RequestCancel' or something.

Then as part of the infant pipeline worker checking iterations (Until) if it picks up the request it does the cancellations for you using a function or whatever.

This way the parent stays in control of the cancellation request without being cancelled itself.

@NJLangley
Copy link
Contributor Author

The 'RequestCancel' idea seems interesting, and definitely worth exploring some more.

Our main concern is that the BAU running of the system will be handed off to less technical users. They are likely to have access to control running of the framework pipelines, so they can run on-demand loads, or could cancel a load if there is a problem. We wanted to ensure if one of these users cancelled the parent or child pipelines, then the worker pipelines would not be left running in the background with them unaware.

This may be overkill for lots of implementations, but our implementation is built as an optional extra that can be ignored if not needed.

@mrpaulandrew
Copy link
Owner

#85

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants