Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] tx leak when stopping server #2310

Open
1 task done
VGalaxies opened this issue Sep 14, 2023 · 1 comment
Open
1 task done

[Bug] tx leak when stopping server #2310

VGalaxies opened this issue Sep 14, 2023 · 1 comment
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@VGalaxies
Copy link
Contributor

VGalaxies commented Sep 14, 2023

Bug Type (问题类型)

server status (启动/运行异常)

Before submit

  • 我已经确认现有的 IssuesFAQ 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)

Related PRs:

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:

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:

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. 🤔

Vertex/Edge example (问题点 / 边数据举例)

No response

Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

No response

@VGalaxies VGalaxies added the bug Something isn't working label Sep 14, 2023
@imbajin imbajin moved this to 🆕 New in HugeGraph Tasks Sep 14, 2023
@javeme
Copy link
Contributor

javeme commented Sep 14, 2023

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

@javeme javeme assigned zyxxoo and unassigned coderzc Sep 14, 2023
@imbajin imbajin moved this from 🆕 New to Newcomer Task in HugeGraph Tasks Apr 15, 2024
@imbajin imbajin added the good first issue Good for newcomers label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
Status: ⚾️ Newcomer Task
Development

No branches or pull requests

5 participants