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 · 0 comments

Comments

Projects
None yet
2 participants
@dominykas
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.