Skip to content

Prevent occasional OTel SQLite writing slowdowns - #8950

Merged
vito merged 6 commits into
dagger:mainfrom
vito:otel-slow-shutdown
Nov 14, 2024
Merged

vito merged 6 commits into
dagger:mainfrom
vito:otel-slow-shutdown

Conversation

@vito

@vito vito commented Nov 14, 2024 •

Copy link
Copy Markdown
Contributor
  • Early commits add some telemetry which is reverted in later commits. It was marginally useful but way too much noise to ship, so I left the original commits and reverted in case we want to bring it back.
  • The main fix switches SQLite from synchronize=NORMAL to synchronize=OFF so we don't randomly block on syncing changes to disk. This should fix the root issue, I think - 8 runs of test all didn't show any more SQLite timeouts.
  • The secondary change reverts a previous change to remove transactions (don't bother with transactions for client DB #8861). This didn't help the user facing begin tx: database is locked at all - they just started to see context deadline exceeded instead. I think synchronize=OFF is the true fix for all of this.

@vito
vito force-pushed the otel-slow-shutdown branch from 8cc7baf to 85082b0 Compare November 14, 2024 00:06
vito added 5 commits November 13, 2024 19:08
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
All of this data is ephemeral - we don't care if we lose it on a system
crash. Setting synchronous=NORMAL opens up to slowdowns from random I/O
blocks, as observed when running `test all`.

Without this change we could occasionally see a span insert blocking for
more than 10 seconds, triggering a timeout when shutting down the OTel
proxy server. The odds of this happening in `test all` were pretty high
- at least one in two runs.

After this change I have been able to run `test all` 8 times and none of
them hit that particular issue. (Three failed, but that's neither here
nor there.)

Signed-off-by: Alex Suraci <[email protected]>
This reverts commit 925cf02.

This didn't end up helping the one user it affected, and it feels better
for each request to be all-or-nothing considering OTel will retry
requests.

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito force-pushed the otel-slow-shutdown branch from 9021853 to 16ea5cd Compare November 14, 2024 15:42
@vito vito changed the title Debugging slow OTel proxy shutdown Prevent occasional OTel SQLite writing slowdowns Nov 14, 2024
@vito
vito marked this pull request as ready for review November 14, 2024 15:45
@vito
vito requested a review from sipsma November 14, 2024 15:45
@vito
vito merged commit e40b692 into dagger:main Nov 14, 2024
@vito
vito deleted the otel-slow-shutdown branch November 14, 2024 18:31
TomChv pushed a commit to TomChv/dagger that referenced this pull request Nov 21, 2024
* engine: set synchronous=OFF for client DBs

All of this data is ephemeral - we don't care if we lose it on a system
crash. Setting synchronous=NORMAL opens up to slowdowns from random I/O
blocks, as observed when running `test all`.

Without this change we could occasionally see a span insert blocking for
more than 10 seconds, triggering a timeout when shutting down the OTel
proxy server. The odds of this happening in `test all` were pretty high
- at least one in two runs.

After this change I have been able to run `test all` 8 times and none of
them hit that particular issue. (Three failed, but that's neither here
nor there.)

Signed-off-by: Alex Suraci <[email protected]>

* Revert "don't bother with transactions for client DB (dagger#8861)"

This reverts commit 925cf02.

This didn't end up helping the one user it affected, and it feels better
for each request to be all-or-nothing considering OTel will retry
requests.

Signed-off-by: Alex Suraci <[email protected]>

---------

Signed-off-by: Alex Suraci <[email protected]>
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