You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hugegraph.apache.org by "VGalaxies (via GitHub)" <gi...@apache.org> on 2023/09/14 07:55:21 UTC

[GitHub] [incubator-hugegraph] VGalaxies opened a new issue, #2310: [Bug] tx leak when stopping server

VGalaxies opened a new issue, #2310:
URL: https://github.com/apache/incubator-hugegraph/issues/2310

   ### Bug Type (问题类型)
   
   server status (启动/运行异常)
   
   ### Before submit
   
   - [X] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 [FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)
   
   ### Environment (环境信息)
   
   - Server Version: 1.0.0 (Apache Release Version)
   - Backend: RocksDB x nodes, HDD or SSD 
   - OS: x86_64 Linux 6.4.3-arch1-2
   
   ### Expected & Actual behavior (期望与实际表现)
   
   When I try to stop the server (by script or in IDEA), the following error occurs:
   
   ```plain
   2023-09-14 14:34:00 [gremlin-server-stop] [WARN] o.a.t.g.s.GremlinServer - Exception while closing Graph instance [hugegraph]
   java.lang.IllegalStateException: Ensure tx closed in all threads when closing graph 'hugegraph'
   	at com.google.common.base.Preconditions.checkState(Preconditions.java:531) ~[guava-25.1-jre.jar:?]
   	at org.apache.hugegraph.util.E.checkState(E.java:64) ~[hugegraph-common-1.0.0.jar:1.0.0]
   	at org.apache.hugegraph.StandardHugeGraph.close(StandardHugeGraph.java:971) ~[hugegraph-core-1.0.0.jar:1.0.0]
   	at org.apache.tinkerpop.gremlin.server.GremlinServer.lambda$null$7(GremlinServer.java:307) ~[gremlin-server-3.5.1.jar:3.5.1]
   	at java.util.concurrent.ConcurrentHashMap$KeySetView.forEach(ConcurrentHashMap.java:4696) ~[?:?]
   	at org.apache.tinkerpop.gremlin.server.GremlinServer.lambda$stop$8(GremlinServer.java:304) ~[gremlin-server-3.5.1.jar:3.5.1]
   	at java.lang.Thread.run(Thread.java:829) [?:?]
   ```
   
   This is because after closing, the `refs` in `TinkerPopTransaction` are not zeroed:
   
   ```java
   public boolean closed() {
       int refs = this.refs.get();
       assert refs >= 0 : refs;
       return refs == 0;
   }
   ```
   
   By logging the value of `refs`, I noticed that when configuring `org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin` as `scripts/empty-sample.groovy` in `conf/gremlin-server.yaml`, the `refs` value is 1. When configured as `scripts/example.groovy`, the `refs` value is 2. 🤔
   
   Related PRs:
   
   - https://github.com/apache/incubator-hugegraph/pull/2031
   
   
   ### Vertex/Edge example (问题点 / 边数据举例)
   
   _No response_
   
   ### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
   
   _No response_


-- 
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: dev-unsubscribe@hugegraph.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-hugegraph] javeme commented on issue #2310: [Bug] tx leak when stopping server

Posted by "javeme (via GitHub)" <gi...@apache.org>.
javeme commented on issue #2310:
URL: https://github.com/apache/incubator-hugegraph/issues/2310#issuecomment-1719173641

   This is a known issue, but currently there is no perfect solution.
   @zyxxoo can you take a look? 


-- 
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [I] [Bug] tx leak when stopping server [incubator-hugegraph]

Posted by "hahahahbenny (via GitHub)" <gi...@apache.org>.
hahahahbenny commented on issue #2310:
URL: https://github.com/apache/incubator-hugegraph/issues/2310#issuecomment-2949062658

   Hello! I saw the post about good first issues and found this bug particularly interesting. Would it be okay if I worked on it and had it assigned to me? 
   
   After investigating, I discovered that the issue occurs in the main thread. The main thread  did not commit and close the transaction after checking the `supportsPaging` property fort the last time.
   
   so we need to add two code to restoreTasks 
   ```
           this.graph.graphTransaction().commit();
           this.graph.closeTx();
   ```
   


-- 
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [I] [Bug] tx leak when stopping server [incubator-hugegraph]

Posted by "VGalaxies (via GitHub)" <gi...@apache.org>.
VGalaxies closed issue #2310: [Bug] tx leak when stopping server
URL: https://github.com/apache/incubator-hugegraph/issues/2310


-- 
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: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org