I am seeing similar logs even after I add db.SetConnMaxLifetime(10 * time.Second).
Test code here: https://play.golang.org/p/itTUXDYv4Ge Any suggestions on how to debug further? On Monday, December 25, 2017 at 12:10:02 PM UTC+5:30, Naoki INADA wrote: > > >> >> To prevent further errors set connection lifetime to value less than >> configured. >> >> >> eg. db.SetConnMaxLifetime(time.Second * 14400) >> >> >> > Thanks, but I (go-sql-driver/mysql maintainer) recommend 10~60 sec > rather than 1/2 of wait_timeout. > > wait_timeout is not the only reason which close TCP connection. > TCP connection may be killed by various reasons. (OS, router, etc...) > > When people ask this question, they doesn't have enough skill to > check all possibilities by themselves. > On the other hand, 10sec is large enough to reduce overhead of > reconnection. > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.