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

server.stop timeout does not apply to onPreStop extension point #3944

Closed
dominykas opened this issue Apr 12, 2019 · 1 comment
Closed

server.stop timeout does not apply to onPreStop extension point #3944

dominykas opened this issue Apr 12, 2019 · 1 comment
Assignees
Labels
Milestone

Comments

@dominykas
Copy link
Contributor

@dominykas dominykas commented Apr 12, 2019

What are you trying to achieve or the steps to reproduce?

Calling await server.stop({ timeout: 1000 }); and expecting the server to shut down in max 1s.

What was the result you received?

The server never shutdown, because one of the plugins returned a hanging promise during onPreStop.

What did you expect?

Either the server should have shut down, or API docs need a bit of clarification. I think shutting down is probably what I'd prefer personally. The workaround is to await Promise.race([server.stop({ timeout: 1000 }), Hoek.wait(1000)]); and then crash the process (if you intended to crash).

Context

  • node version: 10.15.3
  • hapi version: 18.1.0
@hueniverse hueniverse self-assigned this Apr 17, 2019
@hueniverse hueniverse added the bug label Apr 17, 2019
hueniverse added a commit that referenced this issue Apr 17, 2019
@hueniverse hueniverse added this to the 18.2.1 milestone Apr 19, 2019
@lock
Copy link

@lock lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants