Improvments for startup and shutdown#926
Merged
lonvia merged 4 commits intokomoot:masterfrom Jul 19, 2025
Merged
Conversation
Collaborator
Author
|
Sure. And when we don't do this else-if, we have potentially esServer.close() being called concurrently from two different threads. Fun, isn't it? |
Collaborator
Author
|
Alright, version with proper thread-safe shutdown of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
On startup, Photon will now only create the database directory when in import mode. In all other mode if expects the directory to be existing and will bail out if it cannot be found. This should make it easier for users to understand the error when they have downloaded the wrong index dump (ElasticSearch vs. OpenSearch). OpenSearch makes an exception when using an external OS instance. The data directory will be ignored in this case. The situation is slightly different for ElasticSearch because it still needs to copy in the painless plugin.
On shutdown, Photon now catches when the API is stopped via Ctrl-C or similar and properly shuts down the node first when running with an internally started database. I've seen very rare cases of database corruption in the past. Proper shutdown hopefully solves those.