You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed with @ReneWerner87 on discord I would like to propose this feature request to improve the shutdown-procedure of fiber.
I noticed that when I stop my container, open connections are cut off. I have also seen quite a few workarounds, but since there is a general need for proper shutdown handling, I guess it should be implemented by default.
there are two general signals, which at least shall be handeled:
SIGKILL
Log "Fiber forces shutdown"
Fiber kills itself immediately, after logging the last message
SIGTERM
Log "Shutdown received - shutting gracefully down"
Fiber shall not accept any new connections (probably requires all routes to be removed/disabled). Maybe even returning custom error like "shutting down" when disabled route beeing called in combination with an "503"-Error and the additional "retry after" so the incomming connections are handeled as smooth as possible
Fiber checks for open connections.
3.1. Fiber waits "9s" (default gracefully shutdown timeout) long for existing connections to finish themself.
3.1.1. if "9s" pass, it cuts all existing connections and shuts down server.
Check if connections has been cut, or not
4.1. if no connection was cut, Log "Server shutdown complete (Gracefull)"
4.2. if one or more connections has been cut, Log "Server shutdown complete (Graceperiod Exeeded)"
The gracefull shutdowntime (default: 9s) shall be configurable via fiber.Config like this:
Feature Proposal Description
As discussed with @ReneWerner87 on discord I would like to propose this feature request to improve the shutdown-procedure of fiber.
I noticed that when I stop my container, open connections are cut off. I have also seen quite a few workarounds, but since there is a general need for proper shutdown handling, I guess it should be implemented by default.
there are two general signals, which at least shall be handeled:
SIGKILL
SIGTERM
3.1. Fiber waits "
9s
" (default gracefully shutdown timeout) long for existing connections to finish themself.3.1.1. if "
9s
" pass, it cuts all existing connections and shuts down server.4.1. if no connection was cut, Log "Server shutdown complete (Gracefull)"
4.2. if one or more connections has been cut, Log "Server shutdown complete (Graceperiod Exeeded)"
The gracefull shutdowntime (default:
9s
) shall be configurable viafiber.Config
like this:Alignment with Express API
This does not affect anything related to the Express API
HTTP RFC Standards Compliance
This will be complient with RFC7231, specifically the
Retry-After
Part (Section 7.1.3
)API Stability
This would not affect the stability of the API as it solely affects the shutdown.
Feature Examples
Checklist:
The text was updated successfully, but these errors were encountered: