Skip to content

Store repo in pool options#361

Merged
v0idpwn merged 1 commit intomasterfrom
v0idpwn-patch-1
Nov 26, 2021
Merged

Store repo in pool options#361
v0idpwn merged 1 commit intomasterfrom
v0idpwn-patch-1

Conversation

@v0idpwn
Copy link
Copy Markdown
Member

@v0idpwn v0idpwn commented Nov 26, 2021

Useful as options are emitted with :db_connection telemetry events.

This would allow us to correlate telemetry events with the pool owner repo with ease.

Related to discussion in elixir-ecto/db_connection#251

Useful as options are emitted with :db_connection telemetry events.

This would allow us to correlate telemetry events with the pool owner repo with ease.
@v0idpwn
Copy link
Copy Markdown
Member Author

v0idpwn commented Nov 26, 2021

Telemetry metadata with this change:

  metadata: %{
    error: %DBConnection.ConnectionError{
      message: "connection not available and request was dropped from queue after 2265ms. This means requests are coming in and your connection pool cannot serve them fast enough. You can address this by:\n\n  1. Ensuring your database is available and that you can connect to it\n  2. Tracking down slow queries and making sure they are running fast enough\n  3. Increasing the pool_size (albeit it increases resource consumption)\n  4. Allowing requests to wait longer by increasing :queue_target and :queue_interval\n\nSee DBConnection.start_link/2 for more information\n",
      reason: :queue_timeout,
      severity: :error
    },
    opts: [
      log: #Function<14.35606316/1 in Ecto.Adapters.SQL.with_log/3>,
      source: "my_schema",
      repo: EctoBug.RepoWithInit,
      timeout: 15000,
      pool_size: 10,
      pool: DBConnection.ConnectionPool
    ]
  }

@v0idpwn
Copy link
Copy Markdown
Member Author

v0idpwn commented Nov 26, 2021

Not 100% sure if this is desirable tho :))

@v0idpwn v0idpwn merged commit fb72dc8 into master Nov 26, 2021
@v0idpwn v0idpwn deleted the v0idpwn-patch-1 branch November 26, 2021 07:08
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.

2 participants