vesoft-inc / vesoft-inc/nebula-java
Build sessionPool blocking when the connection address is incorrect but the connection can still be established.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 199
- Forks
- 125
- Avg merge
- 5h 6m
- Merged PRs (30d)
- 3
Description
**Describe the bug **
我基于sessionPool进行session管理,并且将sessionPool注册为spring boot bean,但是我们公司测试同事在配置时,错误的将NebulaGraph Studio访问端口配置成了hostAddress,导致服务长时间阻塞于启动状态。
因为我们基于k8s部署,设置了就绪探针,在阻塞几分钟后就被自动重启了,然后一直重复上述的步骤,且期间没有任何可以参考的日志。
后续排查到,最终阻塞在了最后的verifyClientVersion方法内部的recv_verifyClientVersion()。
最终执行到readMessageBegion()之后就阻塞住了。
原因应该是我没有设置timeout,前面一段默认在构建TProtocol时timeout给了一个Integer.MAX_VALUE。
但是一般程序就绪探针的不会设置这么长的时间,这就导致还没有等到超时报错程序就被杀死重启了。
对于这个默认的timeout时间是否可以进行缩短。
**Your Environments **
- JDK:
11
How To Reproduce
- 构建SessionPool时不设置timeout参数
- host设置为一个能连通当不正确的地址,如NebulaGraph Studio的访问地址
- 调用sessionPool构造器
Expected behavior
缩短在timeout未设置时传递给TProtocol的timeout值
Additional context
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the SessionPool constructor and trace how an unset timeout reaches TProtocol, then inspect verifyClientVersion() and recv_verifyClientVersion(), where the report observes the block. Reproduce with a reachable but incorrect host such as the NebulaGraph Studio address. Done means the default timeout is shorter and the session-pool construction no longer waits indefinitely.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100