Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Jetty server is being stopped in OnStopped currently.
OnStopped runs only after the ongoing onTigger() calls have finished, but if the onTrigger() thread hangs up for some reason, OnStopped will never be called and Jetty won't be stopped (which would probably cease the hang-up in onTrigger).
To avoid this possible hang-up: move the stopping logic from OnStopped to OnUnschedule which runs just after the user clicks Stop.
Graceful shutdown could also be implemented: at the beginning of OnUnschedule wait for ongoing request to be finished for a while (with some timeout to avoid hang-up here). Also reject new requests in this period with HTTP 503 + "Server shutting down" response.
Attachments
Issue Links
- links to