Increase MySQL client timeouts from 10 seconds #3707

Merged
merged 1 commit into from Apr 26, 2016

Projects

None yet

3 participants

@brynjare
Contributor

If a single SQL query runs for 10 seconds or more, the connection is killed from the client side.

This could happen when slaving domains with a huge amount of rows - as all existing rows will be deleted in a DELETE statement at the beginning of the transaction, before re-populating the rows again.

With MySQL warnings enabled, MySQL server will log the following:
"[Warning] Aborted connection to db: '' user: '' host: ' (Unknown error)"
... while powerdns (at least in 3.4.1) will log:
"Database failed to start transaction: Failed to execute mysql_query, perhaps connection died? Err=1: Lost connection to MySQL server during query" - none of which make it obvious why the query failed.

Having a configurable timeout is obviously a better alternative, but as a temporary workaround, changing the timeout to a couple of minutes should hopefully minimise the risk in most situations.

@brynjare brynjare Increase MySQL client timeouts from 10 seconds
If a query runs for 10 seconds or more, the connection is killed from the client side.

Bumping this timeout value to three minutes should hopefully be good enough for most situations, until a configurable option can be added.
c22b388
@Habbie Habbie added this to the auth-4-alpha3 milestone Apr 14, 2016
@pieterlexis pieterlexis merged commit 45dcf55 into PowerDNS:master Apr 26, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@brynjare brynjare deleted the brynjare:patch-1 branch Apr 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment