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
@forward32
we suspect that too,
and we tried a db.Ping() every 30 second,
still got the bad connection error,
maybe we need to select now() rather than db.Ping()
Previously, db.Ping did not return error at all (driver bug), so you needed to SELECT 1; in a for loop, and reconnect, if select fails.
Looks like something never changes, and that's why I'm here.
Activity
forward32 commentedon Oct 9, 2019
CH has
idle_connection_timeout
option with default value 1 hour. If you do nothing within this time CH closes your connection.Solutions:
tlightsky commentedon Oct 9, 2019
@forward32
we suspect that too,
and we tried a
db.Ping()
every 30 second,still got the bad connection error,
maybe we need to
select now()
rather thandb.Ping()
forward32 commentedon Oct 9, 2019
Hm, I use second approach (ping once in minute) and it works fine for me.
Try to:
idle_connection_timeout
tlightsky commentedon Oct 9, 2019
@forward32
for now, we try to reconnect if it failed for the first time insertion,
will try to investigate the reason later,
thanks for reply
awskii commentedon Aug 21, 2021
Previously, db.Ping did not return error at all (driver bug), so you needed to
SELECT 1;
in a for loop, and reconnect, if select fails.Looks like something never changes, and that's why I'm here.
kshvakov commentedon Jan 19, 2022
ResetSession added in V2