You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pinged successfully
Pinged successfully
Ping failed: commands out of sync. You can't run this command now[mysql] 2019/02/18 19:15:14 packets.go:393: busy bufferPing failed: bad connection[mysql] 2019/02/18 19:15:24 packets.go:393: busy bufferPing failed: bad connection[mysql] 2019/02/18 19:15:34 packets.go:393: busy bufferPing failed: bad connection
But if we added any Exec() call after the Ping() call
I suppose in this case you should Close() and Open() by yourself. If this is the case, I think this is not meeting the expectation from POV of database/sql since it says here:
Thus, the Open function should be called just once. It is rarely necessary to close a DB.
Have just tried the latest version of master branch 972a708cf97995463843c08c8585b26997daf0e1 and it looks like the issue has already been fixed there:
Pinged successfully
Pinged successfully
Pinged successfully
# here the docker container was restarted...
Ping failed: commands out of sync. You can't run this command nowPing failed: driver: bad connection[mysql] 2019/02/20 11:25:59 packets.go:397: busy buffer[mysql] 2019/02/20 11:25:59 packets.go:397: busy bufferPinged successfullyPinged successfullyPinged successfully
Sorry for your time. I think the issue could be closed now.
When the driver loses connection to MySQL, Ping() starts returning errors regardless of an actual DB server status
For instance if we restarted the MySQL docker container during this script running
$ docker stop 806185fd82bb && docker start 806185fd82bb 806185fd82bb 806185fd82bb
we would start receiving errors forever:
But if we added any Exec() call after the Ping() call
it would solve the problem
$ docker stop 806185fd82bb && docker start 806185fd82bb 806185fd82bb 806185fd82bb
Configuration
The text was updated successfully, but these errors were encountered: