-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Cancel when running a delete #13092
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
Cancel when running a delete #13092
Conversation
@@ -700,6 +703,12 @@ private void deleteConnectionBeforeTerminatingTheWorkflow() { | |||
* Set a job as cancel and continue to the next job if and continue as a reset if needed | |||
*/ | |||
private void reportCancelledAndContinueWith(final boolean isReset, final ConnectionUpdaterInput connectionUpdaterInput) { | |||
reportCancelled(isReset); | |||
resetNewConnectionInput(connectionUpdaterInput); | |||
prepareForNextRunAndContinueAsNew(connectionUpdaterInput); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do any of these methods throw exceptions, particularly RuntimeException
, as I know that we like to use that as a way to signal failures? If so, should this be in a try/finally block to allow one or two of these methods to still fire if the first one or two raises an exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the method are getter/setter so very unlikely to throw a RuntimeException. The method that can throw are run using runMandatoryActivity
which catch any exception and set the job in quarantine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it sounds protected enough to you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -122,6 +122,9 @@ public void run(final ConnectionUpdaterInput connectionUpdaterInput) throws Retr | |||
} | |||
|
|||
if (workflowState.isDeleted()) { | |||
if (workflowState.isRunning()) { | |||
reportCancelled(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add a log message here indicating that we are cancelling the job due to deleting the connection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Cancel when running a delete * Add log
What
We currently don't cancel a running job when we are deleting a connection.
This PR is cancelling a running job if it is getting deleted.
It is calling the existing cancel activity if the job is running before deleting the connection.