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

连接mysql 8小时没有访问自动断开 #561

Closed
306495389li opened this issue Jun 10, 2019 · 1 comment
Closed

连接mysql 8小时没有访问自动断开 #561

306495389li opened this issue Jun 10, 2019 · 1 comment

Comments

@306495389li
Copy link

306495389li commented Jun 10, 2019

Expected behavior 期望表现

可以一直正常使用

Actual behavior 实际表现

后台连接的mysql,8小时没有访问自动断开,这边再次请求就报错,应该怎么配置,数据库最终会使用客户的,无法更改mysql的断开事件

@Linary
Copy link
Contributor

Linary commented Jun 10, 2019

@306495389li HugeGraph使用了在JDBC中使用了autoReconnect=true参数,但是它的重连机制是当前这一次请求会失败然后抛异常,但是下一次会重连。

#562 提交会修复此问题,在hugegraph.properties中增加了一个配置项:store.connection_detect_interval,默认 600 秒。

对于每一个HugeGraph与后端(MySQL)的连接,如果该连接之前超过store.connection_detect_interval未使用,则会在本次使用前先试图重连,然后再使用重连后的session做后续操作。

以上步骤对用户透明,用户只需要配置store.connection_detect_interval<=后端服务连接断开时间即可。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants