question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Default ServerConfig implementations do not shut down gracefully

See original GitHub issue

At the moment, several of the server backends will terminate in-progress connections instead of shutting down gracefully. Wherever possible, we should make the default to do a graceful shutdown - this might not be available given the underlying server APIs available in each.

Need to write a test in ServerContract and handle each backend in turn to see if we can make it pass.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
daviddentoncommented, Jul 31, 2020

I’d ideally like to see all of the server’s do graceful shutdown by default (unless it makes them slow to stop if there are no requests). Each of the ServerConfigs should not take any extra config (to make things simple), but also be structured in a way that people can implement their own versions with minimum effort - eg. reusing the Servlet in the Jetty, or the handler in Undertow.

0reactions
nlochschmidtcommented, Aug 2, 2020

@daviddenton I’ve done a preliminary pull request to make stop() block until inflight requests are handled. I’ve chosen 10 seconds as the default graceful shutdown timeout, but the shutdown will occur as soon as the request is handled. This works for small responses but I haven’t checked for streaming and for really large responses where sending the response takes a long time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Source code for flwr.server.app
If no implementation is provided, then `start_server` will use `flwr.server.client_manager. ... str(hist.metrics_centralized)) # Graceful shutdown ...
Read more >
Chapter 2. Starting and Stopping JBoss EAP
JBoss EAP 7 introduced a suspend mode, which suspends server operations gracefully. This allows all active requests to complete normally, but will not...
Read more >
mpm_common - Apache HTTP Server Version 2.4
Specify a timeout after which a gracefully shutdown server will exit. Syntax: GracefulShutdownTimeout seconds. Default: GracefulShutdownTimeout 0. Context: ...
Read more >
WebServer (Helidon Project 2.5.4 API)
Attempt to gracefully shutdown server. It is possible to use returned Single to react. RequestMethod can be called periodically. Returns: a single to ......
Read more >
Configuring Unleash
PS! Unleash will listen for the SIGINT signal and automatically trigger graceful shutdown of Unleash. If you need to stop Unleash (close database...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found