Friday, May 31, 2019

[google-cloud-sql-discuss] Re: Timeout Errors connecting to a Google Cloud SQL instance from a webpage

Hi, this "Aborted connection nnnn to db:" error message is triggered when an existing connection is terminated improperly, which may look erroneous but is actually perfectly normal. 

Aborted connections happen because of unclean closure of connection or networking problem between the server and the client, but not because of the server [1].

You should note that this error does not mean that there are problems with your Cloud SQL instance and as far as I know these types of errors in the mysql logs are harmless but seem to be useful to indicate client side behaviors because of the following:

1) It won't trigger "Aborted connection" error when mysql client closes cleanly.
2) If the proxy client is killed but didn't close mysql client --> The socket connection is still alive.
    a) manually close the socket connection at the client side
    b) OR wait until times out based "wait_timeout" in MySQL server and the connection closed --> "Aborted connection" error. 

The official MySQL documentation suggests various reasons why this could happen and some actions to take [2]. And this blog goes into more details on fixes [3].

In conclusion, if you want to reduce such errors in the logs, I'd suggest to cleanly close each connection

[1] https://cloud.google.com/sql/docs/mysql/diagnose-issues#connection
[2] https://dev.mysql.com/doc/refman/8.0/en/communication-errors.html
[3] https://www.percona.com/blog/2016/05/16/mysql-got-an-error-reading-communication-packet-errors/

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/bcd19643-188a-4cd9-bde1-fc87d88ea93e%40googlegroups.com.

No comments:

Post a Comment