Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
node shutdown: make close() syncronized
An example scenario where this will help: When the node is shutdown via api call (https://github.com/elasticsearch/elasticsearch/blob/master/src/test/java/org/elasticsearch/test/ExternalNode.java#L219 ) then the call returns immediately even if the node is not actually shutdown yet (https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/action/admin/cluster/node/shutdown/TransportNodesShutdownAction.java#L226). If at the same time the proces is killed, then the hook that would usually prevent uncontrolled shutdown (https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java#L75) has no effect: It again calls close() which might then just return for example because one of the lifecycles was moved to closed already. The bwc test FunctionScoreBackwardCompatibilityTests.testSimpleFunctionScoreParsingWorks failed because of this. The translog was not properly written because if the shutdown was called via api, the following process.destroy() (https://github.com/elasticsearch/elasticsearch/blob/master/src/test/java/org/elasticsearch/test/ExternalNode.java#L225) killed the node before the translog was written to disk. closes #7885
- Loading branch information