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
sometimes when developer forget to call SetConnMaxLifetime(sql api), or when developer use mysql with a proxy server, and the proxy server restart.
at these times, the connection is closed, the api return ErrInvalidConn. but this can not distinguish the error is connection is already closed , or other unexpect error。
so, when receive this error(ErrInvalidConn), developer can not decide appropriate retry is appropriate。
so, how about to return io.EOF when receive io.EOF . such as :
and return driver.ErrBadConn when read the packet length, such as:
if return driver.ErrBadConn, the go sql api will retry again to fix closed connection, this can work gracefull
The text was updated successfully, but these errors were encountered:
if return driver.ErrBadConn, the go sql api will retry again to fix closed connection, this can work gracefull
It is not an option. After we send any query, the query may be executed even if we received EOF.
You shouldn't restart proxy server while application is online.
sometimes when developer forget to call SetConnMaxLifetime(sql api), or when developer use mysql with a proxy server, and the proxy server restart.
at these times, the connection is closed, the api return ErrInvalidConn. but this can not distinguish the error is connection is already closed , or other unexpect error。
so, when receive this error(ErrInvalidConn), developer can not decide appropriate retry is appropriate。
so, how about to return io.EOF when receive io.EOF . such as :

and return driver.ErrBadConn when read the packet length, such as:

if return driver.ErrBadConn, the go sql api will retry again to fix closed connection, this can work gracefull

The text was updated successfully, but these errors were encountered: