Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Handle the pipeline being aborted while finalizing an async operation #1372

Merged
merged 2 commits into from
Apr 30, 2019

Conversation

ajsutton
Copy link
Contributor

PR description

When an async processing stage of a pipeline has started the async process for all inputs it enters finalisation mode where it waits for the outstanding tasks to complete. If Pantheon is shutdown while this finalisation is in progress it may delay shutdown because it doesn't check for the abort signal.

This changes the finalisation process so that when the thread is interrupted (or a task completes) it checks if the input pipe has been aborted and aborts finalisation to ensure we get a clean shutdown.

inputPipe.abort();
return false;
});
inputPipe.close();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need to close the inputPipe here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because otherwise the processor won't enter the finalisation stage, it will wait forever for the next input.

@ajsutton ajsutton merged commit 79ca24c into PegaSysEng:master Apr 30, 2019
@ajsutton ajsutton deleted the fix-shutdown branch April 30, 2019 19:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants