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

fix: reject promise on failed kill #112

Merged
merged 2 commits into from
Jun 8, 2018
Merged

fix: reject promise on failed kill #112

merged 2 commits into from
Jun 8, 2018

Conversation

patrickhulce
Copy link
Collaborator

if you've tried to launch canary today you may have noticed some strange behavior...
image

even if you ctrl-c, it just keeps on chugging. turns out we never resolve/reject the promise on a failed kill and so our sig int handler sits there forever

@paulirish paulirish merged commit f126c3a into master Jun 8, 2018
@paulirish paulirish deleted the fix_kill_behavior branch June 8, 2018 21:43
await instance.kill();
try {
await instance.kill();
} catch (err) {
Copy link
Contributor

Choose a reason for hiding this comment

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

A log here I think would be a good idea instead of silently eating the error.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The only reject path is already logging the error, would you prefer it moved up here?

if (this.chrome) {
this.chrome.on('close', () => {
delete this.chrome;
this.destroyTmp().then(resolve);
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm can you explain why this line moved? Was there a race in waiting for chrome to close?

Copy link
Collaborator Author

@patrickhulce patrickhulce Jun 11, 2018

Choose a reason for hiding this comment

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

If we didn't close Chrome, the process is still live. Removing the handle to it suggests this instance can resume operating normally now even though something has gone wrong.

It seems like this is the logical place to be deleting our handle to it, no?

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

Successfully merging this pull request may close these issues.

3 participants