Skip to content

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

@dominykas

Description

@dominykas

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

Metadata

Metadata

Assignees

Labels

bugBug or defect

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions