imbajin commented on code in PR #812:
URL: 
https://github.com/apache/hugegraph-toolchain/pull/812#discussion_r4250545470


##########
hugegraph-loader/src/main/java/org/apache/hugegraph/loader/executor/LoadContext.java:
##########
@@ -206,10 +208,11 @@ public void updateSchemaCache() {
         this.schemaCache.updateAll();
     }
 
-    public void setLoadingMode() {
+    public synchronized void setLoadingMode() {
         String graph = this.client.graph().graph();
         try {
             this.client.graphs().mode(graph, GraphMode.LOADING);
+            this.loadingModeSet = true;

Review Comment:
   Independent source cross-check at ff53da8 confirms the ambiguous-response 
gap: the mode PUT may apply even though the client never receives success, 
leaving loadingModeSet=false and skipping cleanup. However, treating every 
non-ServerException as ownership would be unsafe: a connection failure before 
sending the request could then clear another loader's LOADING state. Reading 
LOADING back does not establish ownership.
   
   The minimal bounded fix is to retain the guard and original failure, but 
emit an actionable warning containing graphspace/graph, the possibility that 
the mode already changed, and the need to check the mode and confirm no active 
import before manually resetting it. The request path can throw IOException via 
@SneakyThrows, so catching RuntimeException alone misses it. Please add a 
regression for the warning while preserving the existing no-unowned-reset 
assertion.
   
   The impact is narrower than all writes: residual LOADING skips the 
non-null-property check for new-vertex commits until the mode is reset or the 
graph instance is reinitialized. This is source verification, not a reproduced 
deployment failure.
   
   References: 
https://github.com/apache/hugegraph-toolchain/blob/ff53da88b44b958a3de54a86d92be4791f0aeff3/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/unit/LoadContextTest.java#L598-L631
 and 
https://github.com/apache/hugegraph/blob/68fb04536b3c550e6c9cddbc6934dd4bcbb87cae/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/GraphTransaction.java#L335-L348



-- 
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]

Reply via email to