`CentralDogma` may incorrectly report status as healthy when shutting down
Currently, CentralDogma shuts down resources in the following order:
- sessionManager
- file channels
- executors
- the server
https://github.com/line/centraldogma/blob/e93bc5a04eb3d38a0f315d9c5fdb0db3b0af1f52/server/src/main/java/com/linecorp/centraldogma/server/CentralDogma.java#L828-L832
As more long running tasks/repositories are added to CentralDogma (either from the API or via plugins), it is more likely that shutting down will take more time at intermediate steps.
When CentralDogma starts shutting down the actual server, health check will be turned off and the server will stop receiving requests.
https://github.com/line/centraldogma/blob/e93bc5a04eb3d38a0f315d9c5fdb0db3b0af1f52/server/src/main/java/com/linecorp/centraldogma/server/CentralDogma.java#L904
We may do one of the following:
- try to shut down the server before cleaning up internal resources
- set the server status as unhealthy before starting to shut down resources