Skip to content
gqlxj1987's Blog
Go back

Three Bug in go mysql driver

Edit page

原文链接

####Invalid connection (unexpected EOF)

This becomes an issue when the server closes an active connection in the Command Phase, because it reached its idle timeout, or because connections are actively being pruned by processes such as pt-kill

image-20200523173856382

理想方式,判断该connection是否可用

check connection health

Each incoming HTTP request provides a Context object, which becomes canceled if the client disconnects early, and on top of it you can extend your Context with a deadline.

Returning temporary memory is actually an important optimization, which is explicitly encouraged in the driver contract, and works well in practice for MySQL because it lets us return pointers to the connection buffer where we’re reading results directly from MySQL.


Edit page
Share this post on:

Previous Post
Flink cep intro
Next Post
Lyft Flink