Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Nima] Set running flag to false in shutdownhook #6428

Merged

Conversation

wojtask9
Copy link
Contributor

@wojtask9 wojtask9 commented Mar 17, 2023

Currently shutdownhook doesn't set flag running to false.
Setting to false is useful because we can test that WebServer.isRunning() in user custom hook

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Mar 17, 2023
@spericas
Copy link
Member

@wojtask9 Not sure I follow the use case you have in mind. Could you include a unit test? Also shutdown hooks are executed in an undefined order by the JDK.

@wojtask9
Copy link
Contributor Author

wojtask9 commented Mar 21, 2023

@spericas
Not particular use case.
As you said shoutdown hooks are executed in an undefined order so there is no guarantee that this be useful but at least shows true about current webserver status.

Also this align with method stopIt() where such flag is correctly assigned

https://github.com/helidon-io/helidon/blob/main/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/LoomServer.java#L204

@romain-grecourt romain-grecourt merged commit 4516a81 into helidon-io:main Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants