Skip to content

Update tracing fork to PostgresNIO 1.33.1 - #1

Closed
0xpablo wants to merge 12 commits into
mainfrom
goodnotes/tracing-1.33.1
Closed

Update tracing fork to PostgresNIO 1.33.1#1
0xpablo wants to merge 12 commits into
mainfrom
goodnotes/tracing-1.33.1

Conversation

@0xpablo

@0xpablo 0xpablo commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Temporary validation PR for the 1.33.1-goodnotes.1 release. This forward-ports the existing distributed tracing feature onto upstream PostgresNIO 1.33.1 and updates swift-distributed-tracing to 1.4.1. The PR will be closed after the full CI matrix validates the release commit; the old tracing branch remains untouched.

fabianfett and others added 12 commits March 30, 2026 16:30
…por#641)

When the idle-timeout timer fires while a lease request is queued
(because a keep-alive is consuming the connection's only stream),
`connectionIdleTimerTriggered` takes the `rescheduleIdleTimer` path.
That path replaced the stale idle timer with a fresh one but dropped
the old timer's `cancellationContinuation` — a
`CheckedContinuation<Void, Never>` registered by
`ConnectionPool.runTimer`'s child task in `withCheckedContinuation`.
Dropped without being resumed, the Swift runtime eventually emits:

    SWIFT TASK CONTINUATION MISUSE: runTimer(_:in:) leaked its
    continuation without resuming it.

Fix:

- `ConnectionState.rescheduleIdleTimer()` and
  `ConnectionGroup.rescheduleIdleTimer(_:)` now also return the old
  idle timer's `TimerCancellationToken`.
- `PoolStateMachine.connectionIdleTimerTriggered(_:)` forwards that
  token via `.makeConnectionsCancelAndScheduleTimers` so
  `ConnectionPool.runConnectionAction` resumes the continuation before
  scheduling the new timer.

A new regression test in `PoolStateMachineTests` drives the state
machine into the exact race and asserts the returned action surfaces
the old token. The test fails on `main` and passes with this fix.

Signed-off-by: Lukas Tetzlaff <lukastetzlaff@gmail.com>
Co-authored-by: Fabian Fett <fabianfett@apple.com>
@0xpablo

0xpablo commented Jul 28, 2026

Copy link
Copy Markdown
Owner Author

Validation complete: all ten CI jobs passed on d38dbc7, and 1.33.1-goodnotes.1 has been tagged and released. Closing this temporary validation PR without merging into main.

@0xpablo 0xpablo closed this Jul 28, 2026
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.

5 participants