Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jira link
Follow up to a bug introduced in https://tools.hmcts.net/jira/browse/DTSPO-17277
Change description
Previously this was completely broken, it only worked on the
https
server which is only used locally.It also only stopped new requests after 4 seconds and then began closing them.
Shuts the server down so that new connections are no longer accepted by the server.
A hard shutdown of the server happens at 10 seconds now.
Testing done
I implemented a route with a delay of 10 seconds and then 20 seconds before it responds.
The 10 second route shutdown cleanly with a 10 second delay roughly:
The 20 second route was forcefully shutdown:
With no open connections it shuts down immediately:
I reverted the healthcheck changes as when no more connections are allowed it never responded anyway:
Checklist