Skip to content
This repository has been archived by the owner on Mar 3, 2021. It is now read-only.

Handle SIGTERM error when the process already finished #114

Merged
merged 1 commit into from
Oct 6, 2020

Conversation

mskonovalov
Copy link

@mskonovalov mskonovalov commented Sep 30, 2020

fix for part 1 of #113

when interrupt signal is sent the child process might be almost finished. So sending SIGTERM to it may result in Error os: process already finished. I think it is a legit situation. We need to handle this error as a success case. (will send out a PR for it)

@atlassian-cla-bot
Copy link

atlassian-cla-bot bot commented Sep 30, 2020

Hooray! All contributors have signed the CLA.

@@ -81,6 +81,10 @@ func (p *process) run(ctx context.Context) error {
return nil
}

func isFinished(err error) bool {
return err.Error() == "os: process already finished"
Copy link
Author

Choose a reason for hiding this comment

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

correct me if I'm wrong but it doesn't seem to be any better way because the instance of the error that got returned is package private unfortunately :(

@ash2k ash2k merged commit e5a2050 into atlassian:master Oct 6, 2020
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