-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
Issue description
Occasionally, an error occurs, but it is not consistently reproducible. Sometimes, after a long period of inactivity, the error appears when a query is executed. I have already set ConnMaxLifetime, which makes this issue even more puzzling.
Example code
sqlDB, _ := db.DB()
sqlDB.SetMaxIdleConns(10)
sqlDB.SetMaxOpenConns(100)
sqlDB.SetConnMaxLifetime(time.Duration(240) * time.Second)Error log
[mysql] 2024/05/17 09:19:00 packets.go:122: closing bad idle connection: EOF
[mysql] 2024/05/17 09:19:00 connection.go:173: driver: bad connection
Configuration
Driver version (or git SHA): v1.7.1
Go version: go1.21.4
Server version: MySQL 8.0.23
Server OS: debian:stable-slim
Metadata
Metadata
Assignees
Labels
No labels