Skip to content

fix: keep client connected when LISTEN/NOTIFY run with pub/sub disabled - #1884

Merged
murex971 merged 3 commits into
mainfrom
fix/pub-sub-disabled
Oct 28, 2026
Merged

murex971 merged 3 commits into
mainfrom
fix/pub-sub-disabled

Conversation

@murex971

@murex971 murex971 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

LISTEN and NOTIFY with pub/sub disabled (pub_sub_channel_size = 0, the default) returned FATAL: pub/sub disabled and closed the client connection. Fixes #1808.

The error is now reported with SQLSTATE 0A000, the connection stays open, and an open transaction is marked failed. The hint tells the client to set pub_sub_channel_size.

NOTIFY inside a transaction is rejected immediately. Those notifications are buffered and sent after COMMIT, so failing then would close the connection after the client was told the commit succeeded.

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.87640% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pgdog/src/frontend/client/query_engine/pub_sub.rs 96.42% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

ProjectPgDog
Branchfix/pub-sub-disabled
TestbedIntel v1

⚠️ WARNING: Truncated view!

The full continuous benchmarking report exceeds the maximum length allowed on this platform.

🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

ProjectPgDog
Branchfix/pub-sub-disabled
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 %)
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
40.43 units
(-4.25%)Baseline: 42.23 units
42.86 units
(94.33%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

ProjectPgDog
Branchfix/pub-sub-disabled
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.43 units
(-4.60%)Baseline: 43.43 units
44.08 units
(93.99%)
🐰 View full continuous benchmarking report in Bencher

@jkaczman
jkaczman force-pushed the fix/pub-sub-disabled branch from 08e8d35 to 2328831 Compare October 22, 2026 23:24
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Metal bench passed. All 150 measures within bounds.

suite throughput cpu/txn user cycles/txn user instr/txn kernel cycles/txn ctx/txn
pooler 28.73 (+0.6% ± 1.3%) 29,940 (+0.4% ± 1.6%) 35,018 (-0.0% ± 0.03%) 38,862 (+1.0% ± 1.9%)
lb 29.66 (+1.3% ± 0.8%) 31,234 (+0.3% ± 1.1%) 35,894 (-0.1% ± 0.03%) 39,783 (+2.5% ± 1.5%)
sharding-w2 52.94 (-0.5%) 68,126 (-3.1%) 72,262 (-0.0%) 61,389 (+1.9%) 1.404 (+0.5%)
sharding-w8 154,222 (-2.0%) 47.6 (+1.9%) 68,566 (+1.4%) 56,095 (+0.0%) 54,126 (+2.4%) 0.1444 (+0.9%)
Counters per txn
suite frontend stall l1i refill backend stall
pooler 16,492 (+1.0% ± 3.2%) 3,451 (-0.4% ± 1.3%) 2,202 (-1.6% ± 2.7%)
lb 17,249 (+1.1% ± 2.2%) 3,508 (-0.6% ± 1.2%) 2,417 (-3.5% ± 3.0%)
sharding-w2 39,786 (-6.1%) 5,486 (-0.6%) 6,372 (+5.5%)
sharding-w8 39,973 (+2.8%) 5,168 (+1.5%) 8,709 (-2.4%)

Microbench: all 135 measures within bounds.

  • extended_cached: 15 of 15 benches faster, median -3.8% ± 0.5%
  • extended_cold: 14 of 15 benches faster, median -3.3% ± 0.6%
  • simple_cold: 14 of 15 benches faster, median -1.7% ± 0.3%
lb flamegraph vs b66fc9e

lb

Open interactive for hover, zoom and search.

lb removed

Open interactive.

microbench flamegraph vs b66fc9e

microbench

Open interactive for hover, zoom and search.

microbench removed

Open interactive.

pooler flamegraph vs b66fc9e

pooler

Open interactive for hover, zoom and search.

pooler removed

Open interactive.

sharding-w2 flamegraph vs b66fc9e

sharding-w2

Open interactive for hover, zoom and search.

sharding-w2 removed

Open interactive.

sharding-w8 flamegraph vs b66fc9e

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 335259b with b66fc9e.

@jkaczman
jkaczman self-requested a review October 27, 2026 18:29
Comment thread pgdog/src/frontend/client/query_engine/test/pub_sub.rs Outdated
@murex971
murex971 requested a review from jkaczman October 28, 2026 05:55
@murex971
murex971 merged commit 32496c9 into main Oct 28, 2026
55 checks passed
@murex971
murex971 deleted the fix/pub-sub-disabled branch October 28, 2026 13:16
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.

LISTEN with pub/sub disabled returns FATAL and closes the client connection

2 participants