Skip to content

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

Closed

Description

@306495389li

Expected behavior 期望表现

可以一直正常使用

Actual behavior 实际表现

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

Activity

  1. Linary commented on Jun 10, 2019

    @Linary
    Contributor

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions