Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(db): Instrument DB connection lifecycle #1027

Merged
merged 4 commits into from
Feb 8, 2024

Conversation

slowli
Copy link
Contributor

@slowli slowli commented Feb 7, 2024

What ❔

Instruments DB connection lifecycle (acquiring connection call sites, long-living connections). Traces connections for test pools and allows to configure test pool size.

Why ❔

  • Can provide more insights as to which components utilize connections suboptimally.
  • Simplifies testing / DevEx in general.

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via zk fmt and zk lint.
  • Spellcheck has been run via zk spellcheck.
  • Linkcheck has been run via zk linkcheck.

Copy link
Contributor Author

@slowli slowli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An example of a connection timeout error with enabled connection tracing:

called `Result::unwrap()` on an `Err` value: acquire_connection_retried()

Caused by:
    Run out of retries getting a DB connection (requested by `state_keeper` at core/lib/zksync_core/src/state_keeper/io/fee_address_migration.rs:98), last error: pool timed out while waiting for an open connection
    Alive connections: {
        [2024-02-07 10:12:02.526407167 UTC - requested by `state_keeper` at core/lib/zksync_core/src/state_keeper/io/fee_address_migration.rs:74],
    }

core/lib/dal/src/connection/mod.rs Show resolved Hide resolved
core/lib/dal/src/connection/mod.rs Show resolved Hide resolved
core/lib/dal/src/connection/processor.rs Show resolved Hide resolved
core/lib/dal/src/connection/processor.rs Show resolved Hide resolved
core/lib/dal/src/connection/mod.rs Show resolved Hide resolved
core/lib/dal/src/connection/processor.rs Show resolved Hide resolved
@slowli slowli changed the title feat(db): instrument DB connection lifecycle feat(db): Instrument DB connection lifecycle Feb 7, 2024
@slowli slowli marked this pull request as ready for review February 7, 2024 14:02
Copy link
Collaborator

@RomanBrodetski RomanBrodetski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this, cannot wait to see the data

core/lib/dal/src/connection/mod.rs Show resolved Hide resolved
core/lib/dal/src/connection/processor.rs Show resolved Hide resolved
@slowli slowli added this pull request to the merge queue Feb 8, 2024
Merged via the queue into main with commit 636fcfd Feb 8, 2024
33 checks passed
@slowli slowli deleted the aov-pla-785-instrument-db-connection-lifecycle branch February 8, 2024 09:13
github-merge-queue bot pushed a commit that referenced this pull request Feb 8, 2024
🤖 I have created a release *beep* *boop*
---


##
[20.6.0](core-v20.5.2...core-v20.6.0)
(2024-02-08)


### Features

* **api:** Start API server after first L1 batch
([#1026](#1026))
([86e189c](86e189c))
* **db:** Instrument DB connection lifecycle
([#1027](#1027))
([636fcfd](636fcfd))
* **db:** Soft-remove `storage` table
([#982](#982))
([601f893](601f893))
* **en:** Make state keeper work with pruned data
([#900](#900))
([f1913ae](f1913ae))
* export fee model for the test node
([#1030](#1030))
([d1e4774](d1e4774))
* Time-limit health checks and log them
([#993](#993))
([f3c190d](f3c190d))
* **types:** Added KZG info needed for 4844 blobs
([#894](#894))
([758f487](758f487))


### Bug Fixes

* fix link
([#1007](#1007))
([f1424ce](f1424ce))
* **metrics:** Use latest block for non pos ethereum as safe
([#1022](#1022))
([49ec843](49ec843))
* Revert "preparation for shared bridge migration (server)"
([#1010](#1010))
([d4c984a](d4c984a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

None yet

3 participants