Skip to content

connection timeouts and keepalive - #91

Open
james-owen wants to merge 1 commit into
masterfrom
jowen/connection-timeouts
Open

connection timeouts and keepalive#91
james-owen wants to merge 1 commit into
masterfrom
jowen/connection-timeouts

Conversation

@james-owen

Copy link
Copy Markdown
Member

The main knex pool ran queries with no bounds: no statement or query timeout, keepAlive off, and no acquireConnectionTimeout (the createDBIfNotExists bootstrap client already had one), so a statement that never returns holds a pool connection with nothing to cancel it. Adds statement_timeout (300s, server-side) and query_timeout (330s, client-side) to the connection--the server cancels first so the error names the statement that overran--turns on keepAlive, and gives the pool the same acquireConnectionTimeout the bootstrap client uses. Overridable via CLAY_STORAGE_STATEMENT_TIMEOUT and CLAY_STORAGE_QUERY_TIMEOUT. Migrations are unaffected--postgres-migrations gets its own plain connection, not the knex pool. The search-detector's pg client has run against prod with the same 300s statement timeout all week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant