Skip to content

chore: upgrade tokio version - #1897

Merged
meskill merged 4 commits into
mainfrom
meskill-2026-10-26-chore--qtk
Oct 27, 2026
Merged

meskill merged 4 commits into
mainfrom
meskill-2026-10-26-chore--qtk

Conversation

@meskill

@meskill meskill commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Finally tokio has released the new 1.54 version with the fix tokio-rs/tokio#8334.

fixes #1017 since the safetimeout/safeinterval are not necessary anymore and hangs should not happen

@meskill
meskill force-pushed the meskill-2026-10-26-chore--qtk branch from aa01f9d to 240b0ce Compare October 26, 2026 13:09
@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.79518% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pgdog/src/util/time.rs 98.79% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

ProjectPgDog
Branchmeskill-2026-10-26-chore--qtk
TestbedIntel v1
Click to view all benchmark results
BenchmarkThroughputBenchmark Result
operations / second (ops/s) x 1e3
(Result Δ%)
Lower Boundary
operations / second (ops/s) x 1e3
(Limit %)
cpu-per-txnBenchmark Result
Measure (units)
(Result Δ%)
Upper Boundary
Measure (units)
(Limit %)
lb-v3📈 view plot
🚷 view threshold
15.99 ops/s x 1e3
(+0.00%)Baseline: 15.99 ops/s x 1e3
15.83 ops/s x 1e3
(99.00%)
📈 view plot
🚷 view threshold
41.92 units
(+0.45%)Baseline: 41.74 units
42.15 units
(99.46%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Metal bench failed. 1 of 150 measures outside bounds.

suite throughput cpu/txn user cycles/txn user instr/txn kernel cycles/txn ctx/txn
pooler 28.76 (-0.7% ± 1.0%) 27,958 (-2.0% ± 1.3%) 35,135 (-0.5% ± 0.03%) 40,440 (-0.6% ± 1.6%)
lb 29.61 (-1.8% ± 0.5%) 29,446 (-1.6% ± 1.4%) 35,998 (-0.5% ± 0.02%) 41,000 (-2.8% ± 1.2%)
sharding-w2 52.23 (-2.8%) 65,369 (-4.4%) 72,389 (-0.3%) 61,513 (-2.3%) 1.417 (+1.3%)
sharding-w8 164,754 (+2.5%) 43.78 (-3.4%) 62,623 (-4.0%) 56,239 (-0.1%) 50,082 (-2.9%) 0.1617 (+7.6%), bound +3%
Counters per txn
suite frontend stall l1i refill backend stall
pooler 13,885 (-3.4% ± 2.4%) 3,160 (-2.9% ± 0.7%) 2,659 (-1.0% ± 2.7%)
lb 14,828 (-2.8% ± 2.8%) 3,260 (-2.2% ± 1.0%) 2,910 (+0.8% ± 2.2%)
sharding-w2 36,455 (-7.6%) 5,083 (-6.1%) 7,230 (+6.5%)
sharding-w8 33,015 (-6.8%) 4,678 (-5.3%) 10,333 (+4.1%)

Microbench: all 135 measures within bounds.

  • extended_cached: 10 of 15 benches faster, median -1.6% ± 0.4%
  • simple_cold: 13 of 15 benches faster, median -1.3% ± 0.4%
lb flamegraph vs 1ab9634

lb

Open interactive for hover, zoom and search.

lb removed

Open interactive.

microbench flamegraph vs 1ab9634

microbench

Open interactive for hover, zoom and search.

microbench removed

Open interactive.

pooler flamegraph vs 1ab9634

pooler

Open interactive for hover, zoom and search.

pooler removed

Open interactive.

sharding-w2 flamegraph vs 1ab9634

sharding-w2

Open interactive for hover, zoom and search.

sharding-w2 removed

Open interactive.

sharding-w8 flamegraph vs 1ab9634

sharding-w8

Open interactive for hover, zoom and search.

sharding-w8 removed

Open interactive.

Logs

lb, microbench, pooler, sharding-w2, sharding-w8, verdict.json

Compared 043abbb with 1ab9634.

@jkaczman jkaczman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Awesome! it seems the new tokio version also comes with a perf bump :)

also:

'since the safetimeout/safeinterval are not necessary anymore and hangs should not happen'

It doesn't look like this removes any safetimeout/safeinterval, if they're not necessary anymore, should we? Or will that be a follow up PR?

Comment thread Cargo.lock Outdated
"libc",
"once_cell",
"socket2 0.6.3",
"socket2 0.5.10",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm curious why these were bumped downwards

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oh, yeah, interesting, I guess it's partly from the fact that we've been installing 0.5.

I just upgraded the pgdog to 0.6 so we have one version in lock for socket2

Comment thread integration/rust/Cargo.toml Outdated
native-tls = "0.2"
sqlx = { version = "0.8.6", features = ["postgres", "runtime-tokio", "tls-native-tls", "bigdecimal", "chrono", "json", "rust_decimal", "uuid"]}
tokio = { version = "1", features = ["full"]}
tokio = { version = "1.54", features = ["full"]}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: if we're changing it here, probably should also change it in pgdog/Cargo.toml

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

haha, right, not the tests Cargo.toml

I moved this to root cargo.toml as workspace dependency

Comment thread pgdog/src/util/time.rs Outdated
Comment on lines +121 to +123
/// Longest deadline Tokio's timer wheel can address (`64^6` ms, a bit over
/// two years). A longer timer eventually stops every other timer in the
/// runtime from firing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this comment outdated now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes-yes, I removed this constant and the comment

@meskill

meskill commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

It doesn't look like this removes any safetimeout/safeinterval, if they're not necessary anymore, should we? Or will that be a follow up PR?

It should stay - the safe.. wrappers are not only preventing the original issue, but they also check the boundaries like 0 and MAX_DURATION to avoid panics or change the tokio behavior there. So, it mostly to help us not to think about possible edge values that comes from parsed config. And it's just that with the tokio fix it should work fine even if some of the direct tokio calls slips somewhere (no hang, but panic or long timer)

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

ProjectPgDog
Branchmeskill-2026-10-26-chore--qtk
TestbedIntel v1

🚨 1 Alert

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
pooler-v3cpu-per-txn
Measure (units)
📈 plot
🚷 threshold
🚨 alert (🔔)
41.05 units
(+1.08%)Baseline: 40.61 units
41.02 units
(100.08%)

Click to view all benchmark results
BenchmarkThroughputBenchmark Result
operations / second (ops/s) x 1e3
(Result Δ%)
Lower Boundary
operations / second (ops/s) x 1e3
(Limit %)
cpu-per-txnBenchmark Result
Measure (units)
(Result Δ%)
Upper Boundary
Measure (units)
(Limit %)
pooler-v3📈 view plot
🚷 view threshold
16.99 ops/s x 1e3
(+0.00%)Baseline: 16.99 ops/s x 1e3
16.82 ops/s x 1e3
(99.00%)
📈 view plot
🚷 view threshold
🚨 view alert (🔔)
41.05 units
(+1.08%)Baseline: 40.61 units
41.02 units
(100.08%)

🐰 View full continuous benchmarking report in Bencher

@meskill
meskill merged commit cf047d0 into main Oct 27, 2026
53 of 55 checks passed
@meskill
meskill deleted the meskill-2026-10-26-chore--qtk branch October 27, 2026 12:04
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.

Monitor::stats task silently freezes on every pool simultaneously at exactly 2^30 ms uptime

2 participants