dosubot[bot] commented on issue #2667:
URL:
https://github.com/apache/incubator-hugegraph/issues/2667#issuecomment-2380624304
<!-- Answer -->
Yes, if the physical machine suddenly goes down, the `removeSelfServerInfo`
method will not be called, and the server info will stay there indefinitely.
This is because the `removeSelfServerInfo` method is called during the `close`
method, which is executed when the server is shutting down gracefully. If the
machine goes down unexpectedly, this method will not be invoked.
```java
public synchronized boolean close() {
this.closed = true;
if (!this.dbExecutor.isShutdown()) {
this.removeSelfServerInfo();
this.call(() -> {
try {
this.tx().close();
} catch (ConnectionException ignored) {
// ConnectionException means no connection established
}
this.graph.closeTx();
return null;
});
}
return true;
}
```
The `removeSelfServerInfo` method is responsible for removing the server
info, and it is only called within the `close` method. Therefore, if the
machine goes down suddenly, the server info will not be removed
<sup>[[1]](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/ServerInfoManager.java)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]