Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround for shutdown error (#722)
This commit is a workaround for an error which seems to happen since the upgrade to Micronaut 4.6. In a nutshell, when the `/stop` endpoint is called, the thread which was started to monitor if the service is properly shutdown after a timeout was started and the application context was closed, _before_ the `stop` method would return something to the client. As a consequence, there was an error message saying that the application context wasn't open and that a bean (the message writers) weren't found. This was not quite true, since the application context _used to be_ open but wasn't. The workaround, which isn't great, is to use the task scheduler to delay the shutdown by a few hundreds of milliseconds. This gives the opportunity to send the response back to the client _before_ the application context is shutdown. Note that in any case, this wasn't a big issue, since the service would be shutdown anyway, but the error message for the user wasn't great.
- Loading branch information