cloud-sql knex.js related example configuration is inconsistent/confusing #1697
Labels
api: cloudsql
Issues related to the Cloud SQL for MySQL API.
type: question
Request for information or clarification. Not an issue.
I'm coming from the GCloud Documentation's Managing database connections page about PostgreSQL and Node.js while trying to diagnose connection issues with a live Cloud SQL database.
The section on how to configure the Knex Client pool left me wondering in some places, however:
The explanation recommends implementing an exponential backoff, yet here we set a flat value. Does this mean that Knex cannot be configured to do an exponential backoff when acquiring connections?
Right below it, we have:
The comment describes
acquireTimeoutMillis
, yet in the code thecreateTimeoutMillis
is set. Which one is right here? Does it make a difference, and if so, what is the difference?Below, the code then actually sets
acquireTimeoutMillis
:acquireTimeoutMillis
really does not sound like a "total lifetime limit", and indeed tarn.js (where thePool
implementation from knex.js is imported from) describes it like this in their documentation:What configuration option would actually give the described "total lifetime" functionality?
The relevant code pieces are all from cloud-sql/postgres/knex/server.js.
Could someone who is more familiar with the libraries and mechanisms at work here please look over the documentation and the code that goes with it?
Thank you!
The text was updated successfully, but these errors were encountered: