imbajin commented on code in PR #3308:
URL: https://github.com/apache/hugegraph/pull/3308#discussion_r4253762199
##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/TaskManager.java:
##########
@@ -261,7 +251,8 @@ public ServerInfoManager
getServerInfoManager(HugeGraphParams graph) {
}
public void shutdown(long timeout) {
- assert this.schedulers.isEmpty() : this.schedulers.size();
+ E.checkState(this.schedulers.isEmpty(),
Review Comment:
Fixed in [the shutdown-grace
correction](https://github.com/apache/hugegraph/commit/d61a8cd4244927416f50d50ce9ef8f6c1e70a39d).
The introduced hard precondition is now a warning; the existing executor
shutdown/await sequence is preserved. Retained schedulers are not removed and
global resource shutdown does not acknowledge graph closure.
The new isolated regression fails at the old guard. After the correction, a
real worker completes its final database-executor callback and all shared
executors terminate while the scheduler registration remains. Separate Memory
and RocksDB JVMs also ran an actual persistent task through refused graph close
and HugeFactory.shutdown, then queried its SUCCESS record directly from the
backend; graph data/configuration remained intact. The inherited timeout
short-circuit and other producer shutdown-order issues are recorded separately,
without expanding this PR.
##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/StandardHugeGraph.java:
##########
@@ -1212,12 +1213,16 @@ public void create(String configPath, GlobalMasterInfo
nodeInfo) {
@Override
public void drop() {
+ this.checkGraphNotClosed();
+ TaskScheduler scheduler = this.taskManager.getScheduler(this.params);
+ if (scheduler != null && !scheduler.close()) {
+ // Fence admission before waiting for actual task owners to exit.
+ this.waitUntilAllTasksCompleted();
Review Comment:
Addressed in [the maintenance-contract
correction](https://github.com/apache/hugegraph/commit/d61a8cd4244927416f50d50ce9ef8f6c1e70a39d)
using the explicit retained-fence option in this review. Admission remains
closed after refusal. Both local and PD timeout/second-close refusal messages
now say so, with deletion retry after owners exit or server restart to resume
task admission. The runtime document limits restart recovery to before
destructive cleanup and explains that retaining graph data/configuration does
not restore normal asynchronous task service.
The existing local/PD refusal regressions now assert these messages and
reject a new task, while retaining their data/configuration/metadata checks and
successful deletion retry after the original owner exits. Reopening a flag
would not restore the distributed scheduler's cancelled cron, so no recovery
protocol is added here.
--
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]