apache / apache/hugegraph

[Bug] Gremlin post请求不符合预期

Open
#2,284 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
3.2k
Forks
636
Avg merge
3d 11h
Merged PRs (30d)
14

Description

### Bug Type (问题类型)

gremlin (结果不合预期)

### 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: memory
- OS: xx CPUs, xx G RAM, Ubuntu 2x.x / CentOS 7.x
- Data Size: xx vertices, xx edges

### Expected & Actual behavior (期望与实际表现)

正常的Gremlin post请求和返回如下:
```
post http://127.0.0.1:8080/gremlin
{
"gremlin": "g.E('S1:marko>2>>S2:lop')",
"bindings": {},
"language": "gremlin-groovy",
"aliases": {
"graph": "hugegraph",
"g": "__g_hugegraph"
}
}
```
返回
```
{
"requestId": "68505437-7b09-46c6-abb8-5735b0415d98",
"status": {
"message": "",
"code": 200,
"attributes": {}
},
"result": {
"data": [],
"meta": {}
}
}
```

但是,如果我第一次请求aliases中图名写错,比如
```
"aliases": {
"graph": "hugegraph1",
"g": "__g_hugegraph"
}
```
返回时为:
```
{
"exception": "",
"message": "Could not rebind [graph] to [hugegraph1] as [hugegraph1] not in the Graph or TraversalSource global bindings",
"cause": ""
}
```
到这里还是符合预期,**问题出在这个错误请求之后,我把图的名称更正(即此时的gremlin请求是正确的)**,
```
"aliases": {
"graph": "hugegraph",
"g": "__g_hugegraph"
},
```
此时将会返回:
```
{
"exception": "",
"message": "refCnt: 0, decrement: 1",
"cause": ""
}
```

再次请求才会正常

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

_No response_

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

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.