Skip to content

[Bug] [dinky-metadata-base] MySQL wait_timeout After closing the idle connection, the metadata data source connection permanently fails and needs to be restarted to recover. #4570

Description

@coderworld321

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

Image 在 Dinky 中注册的 MySQL 数据源,如果空闲时间超过 MySQL 服务端的 wait_timeout(默认 8 小时),
下次通过该数据源执行操作(如提交 CDCSOURCE 任务读取表元数据)时会抛出 CommunicationsException,
且该数据源之后一直不可用,只能重启 Dinky 才能恢复。

What you expected to happen

Driver 应能检测到失效连接,并自动重建连接,业务无感知。

How to reproduce

  1. 在 Dinky(1.2.5)中注册一个 MySQL 数据源
  2. 让该数据源空闲超过 MySQL 的 wait_timeout (快速复现可在 MySQL 服务端设置 SET GLOBAL wait_timeout=60)
  3. 提交一个通过该数据源读取元数据的任务(如 CDCSOURCE 作业)
    或者提交了一个CDCSOURCE 作业;第二天重启报错复现

Anything else

ERROR com.alibaba.druid.pool.DruidPooledStatement: CommunicationsException, druid version 1.2.23, jdbcUrl : jdbc:mysql://...:3306/test?..., testWhileIdle true, idle millis 58786359, minIdle 5, poolingCount 0 ... ERROR com.alibaba.druid.pool.DruidDataSource: {conn-310002} discard com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 58,786,341 milliseconds ago ... is longer than the server configured value of 'wait_timeout' ...

Version

dev

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingWaiting for replyWaiting for reply

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions