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

ConnectionPool crash on keepalive with non-empty request queue #472

Open
lovetodream opened this issue May 7, 2024 · 2 comments · May be fixed by #474
Open

ConnectionPool crash on keepalive with non-empty request queue #472

lovetodream opened this issue May 7, 2024 · 2 comments · May be fixed by #474
Assignees
Labels
bug Something isn't working

Comments

@lovetodream
Copy link
Contributor

Describe the issue

The connection pool crashes when a lot of requests occur in a burst

Vapor version

n/a

Operating system and version

macOS 14.4.1

Swift version

Swift Package Manager - Swift 5.10.0-dev

Steps to reproduce

Run the following script:

let config = PostgresClient.Configuration(...)
var logger = Logger(label: "connection-pool-crash")
logger.logLevel = .debug

let client = PostgresClient(
    configuration: config,
    backgroundLogger: logger
)
let task = Task {
    await client.run()
}

func runOnce() async throws {
    let logger = logger
    try await withThrowingDiscardingTaskGroup { group in
        for _ in 0..<20 {
            group.addTask {
                let hello = try await client.withConnection { db in
                    try await db.query("SELECT 'hello'", logger: logger)
                }.collect().first?.decode(String.self)
                print(hello)

                // wait for the connection pool to do ping pong and close
                try await Task.sleep(for: .seconds(idleTimeout + 1))
            }
        }
    }
}

for i in 0..<50 {
    try await runOnce()
    print("Burst done: \(i + 1)/50")
}

task.cancel()

Outcome

A crash happens (typically on the start of the second burst, after running the script for approx. 1.5 min), the crash occurs in PoolStateMachine.connectionKeepAliceTimerTriggered(_:) due to a non-empty request queue. My assumption is, that there's a race condition when the timer triggers the ping and the next batch of requests is "inserted" into the pool.

Additional notes

No response

@lovetodream lovetodream added the bug Something isn't working label May 7, 2024
@lovetodream lovetodream changed the title ConnectionPool crash on keepalive with non-empty reuest queue ConnectionPool crash on keepalive with non-empty request queue May 7, 2024
@gwynne
Copy link
Member

gwynne commented May 7, 2024

Thanks for the report! A couple of questions:

  1. You listed your Swift version as 5.10-dev; is this from an Xcode beta, or are you using a nightly toolchain? If the latter, does the crash still occur with the release version of 5.10? Also, do you know if this crash also occurs on Linux?
  2. Can you provide the full backtrace of the crash? You can retrieve the backtrace from Xcode's debugger console (the (lldb) prompt) with the bt all command, or in a commandline build you can set SWIFT_BACKTRACE='enable=yes,threads=all,images=all' in your environment to get a backtrace from the Swift runtime.

@lovetodream
Copy link
Contributor Author

To q1, I do use Xcode 13.3, odd that it says 5.10-dev.
To q2:

thread #1, queue = 'com.apple.main-thread'
    frame #0: 0x00000001923161f4 libsystem_kernel.dylib`mach_msg2_trap + 8
    frame #1: 0x0000000192328b24 libsystem_kernel.dylib`mach_msg2_internal + 80
    frame #2: 0x000000019231ee34 libsystem_kernel.dylib`mach_msg_overwrite + 476
    frame #3: 0x0000000192316578 libsystem_kernel.dylib`mach_msg + 24
    frame #4: 0x0000000192436058 CoreFoundation`__CFRunLoopServiceMachPort + 160
    frame #5: 0x000000019243491c CoreFoundation`__CFRunLoopRun + 1208
    frame #6: 0x0000000192433e0c CoreFoundation`CFRunLoopRunSpecific + 608
    frame #7: 0x00000001924b1e3c CoreFoundation`CFRunLoopRun + 64
    frame #8: 0x0000000258a4a4e0 libswift_Concurrency.dylib`swift_task_asyncMainDrainQueueImpl() + 40
    frame #9: 0x0000000258a4a4a0 libswift_Concurrency.dylib`swift_task_asyncMainDrainQueue + 92
    frame #10: 0x0000000100004604 ConnectionPoolCrash`main at main.swift:0
    frame #11: 0x0000000191fce0e0 dyld`start + 2360
  thread #23, queue = 'com.apple.root.default-qos.cooperative'
    frame #0: 0x0000000192318ea4 libsystem_kernel.dylib`__psynch_mutexwait + 8
    frame #1: 0x00000001025bbe10 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 100
    frame #2: 0x00000001025bbd2c libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 248
    frame #3: 0x00000001001d8a18 ConnectionPoolCrash`static LockOperations.lock(mutex=0x600002f9c0c0, self=_ConnectionPoolModule.LockOperations) at NIOLock.swift:80:19
    frame #4: 0x00000001001d95c0 ConnectionPoolCrash`closure #1 in LockStorage.withLockedValue<τ_0_0>(valuePtr=0x600002f9c010, lockPtr=0x600002f9c0c0, mutate=0x1001cdb88) at NIOLock.swift:174:28
    frame #5: 0x00000001001d9bfc ConnectionPoolCrash`partial apply for closure #1 in LockStorage.withLockedValue<τ_0_0>(_:) at <compiler-generated>:0
    frame #6: 0x00000001a21815a8 libswiftCore.dylib`Swift.ManagedBuffer.withUnsafeMutablePointers<τ_0_0>((Swift.UnsafeMutablePointer<τ_0_0>, Swift.UnsafeMutablePointer<τ_0_1>) throws -> τ_1_0) throws -> τ_1_0 + 180
    frame #7: 0x00000001001d9524 ConnectionPoolCrash`LockStorage.withLockedValue<τ_0_0>(mutate=0x1001cdb88, self=0x0000600002f9c000) at NIOLock.swift:173:18
    frame #8: 0x00000001001da348 ConnectionPoolCrash`NIOLockedValueBox.withLockedValue<τ_0_0>(mutate=0x1001cdb88, self=_ConnectionPoolModule.NIOLockedValueBox<_ConnectionPoolModule.ConnectionPool<PostgresNIO.PostgresConnection, Swift.Int, _ConnectionPoolModule.ConnectionIDGenerator, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, PostgresNIO.PostgresKeepAliveBehavor, PostgresNIO.PostgresClientMetrics, Swift.ContinuousClock>.State> @ 0x00000001703feb28) at NIOLockedValueBox.swift:42:34
    frame #9: 0x00000001001c6960 ConnectionPoolCrash`closure #1 in closure #1 in ConnectionPool.runTimer<τ_0_0>(taskGroup=(_group = 0x0000000128819840 -> 0x000000026e872208 libswift_Concurrency.dylib`vtable for (anonymous namespace)::AccumulatingTaskGroup + 16), self=0x0000600002c94000, timer=_ConnectionPoolModule.PoolStateMachine<PostgresNIO.PostgresConnection, _ConnectionPoolModule.ConnectionIDGenerator, Swift.Int, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, Swift.CheckedContinuation<(), Swift.Never>>.Timer @ 0x000000012881bed0) at ConnectionPool.swift:538:48
    frame #10: 0x00000001001cd314 ConnectionPoolCrash`partial apply for closure #1 in closure #1 in ConnectionPool.runTimer<τ_0_0>(_:in:) at <compiler-generated>:0
    frame #11: 0x0000000258a13ac8 libswift_Concurrency.dylib`(1) await resume partial function for Swift.withTaskGroup<τ_0_0, τ_0_1>(of: τ_0_0.Type, returning: τ_0_1.Type, body: (inout Swift.TaskGroup<τ_0_0>) async -> τ_0_1) async -> τ_0_1
    frame #12: 0x00000001001c5740 ConnectionPoolCrash`closure #1 in ConnectionPool.runTimer<τ_0_0>(self=0x0000600002c94000, timer=_ConnectionPoolModule.PoolStateMachine<PostgresNIO.PostgresConnection, _ConnectionPoolModule.ConnectionIDGenerator, Swift.Int, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, Swift.CheckedContinuation<(), Swift.Never>>.Timer @ 0x0000600002690510) at ConnectionPool.swift:507
    frame #13: 0x00000001001c5d14 ConnectionPoolCrash`partial apply for closure #1 in ConnectionPool.runTimer<τ_0_0>(_:in:) at <compiler-generated>:0
    frame #14: 0x00000001001ccf24 ConnectionPoolCrash`thunk for @escaping @callee_guaranteed @Sendable @async () -> () at <compiler-generated>:0
    frame #15: 0x00000001001cd074 ConnectionPoolCrash`partial apply for thunk for @escaping @callee_guaranteed @Sendable @async () -> () at <compiler-generated>:0
  thread #24, queue = 'com.apple.root.default-qos.cooperative'
    frame #0: 0x0000000192318ea4 libsystem_kernel.dylib`__psynch_mutexwait + 8
    frame #1: 0x00000001025bbe10 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 100
    frame #2: 0x00000001025bbd2c libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 248
    frame #3: 0x00000001001d8a18 ConnectionPoolCrash`static LockOperations.lock(mutex=0x600002f9c0c0, self=_ConnectionPoolModule.LockOperations) at NIOLock.swift:80:19
    frame #4: 0x00000001001d95c0 ConnectionPoolCrash`closure #1 in LockStorage.withLockedValue<τ_0_0>(valuePtr=0x600002f9c010, lockPtr=0x600002f9c0c0, mutate=0x1001cdb88) at NIOLock.swift:174:28
    frame #5: 0x00000001001d9bfc ConnectionPoolCrash`partial apply for closure #1 in LockStorage.withLockedValue<τ_0_0>(_:) at <compiler-generated>:0
    frame #6: 0x00000001a21815a8 libswiftCore.dylib`Swift.ManagedBuffer.withUnsafeMutablePointers<τ_0_0>((Swift.UnsafeMutablePointer<τ_0_0>, Swift.UnsafeMutablePointer<τ_0_1>) throws -> τ_1_0) throws -> τ_1_0 + 180
    frame #7: 0x00000001001d9524 ConnectionPoolCrash`LockStorage.withLockedValue<τ_0_0>(mutate=0x1001cdb88, self=0x0000600002f9c000) at NIOLock.swift:173:18
    frame #8: 0x00000001001da348 ConnectionPoolCrash`NIOLockedValueBox.withLockedValue<τ_0_0>(mutate=0x1001cdb88, self=_ConnectionPoolModule.NIOLockedValueBox<_ConnectionPoolModule.ConnectionPool<PostgresNIO.PostgresConnection, Swift.Int, _ConnectionPoolModule.ConnectionIDGenerator, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, PostgresNIO.PostgresKeepAliveBehavor, PostgresNIO.PostgresClientMetrics, Swift.ContinuousClock>.State> @ 0x000000016fe86b28) at NIOLockedValueBox.swift:42:34
    frame #9: 0x00000001001c6960 ConnectionPoolCrash`closure #1 in closure #1 in ConnectionPool.runTimer<τ_0_0>(taskGroup=(_group = 0x000000012880d440 -> 0x000000026e872208 libswift_Concurrency.dylib`vtable for (anonymous namespace)::AccumulatingTaskGroup + 16), self=0x0000600002c94000, timer=_ConnectionPoolModule.PoolStateMachine<PostgresNIO.PostgresConnection, _ConnectionPoolModule.ConnectionIDGenerator, Swift.Int, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, Swift.CheckedContinuation<(), Swift.Never>>.Timer @ 0x000000012880d2d0) at ConnectionPool.swift:538:48
    frame #10: 0x00000001001cd314 ConnectionPoolCrash`partial apply for closure #1 in closure #1 in ConnectionPool.runTimer<τ_0_0>(_:in:) at <compiler-generated>:0
    frame #11: 0x0000000258a13ac8 libswift_Concurrency.dylib`(1) await resume partial function for Swift.withTaskGroup<τ_0_0, τ_0_1>(of: τ_0_0.Type, returning: τ_0_1.Type, body: (inout Swift.TaskGroup<τ_0_0>) async -> τ_0_1) async -> τ_0_1
    frame #12: 0x00000001001c5740 ConnectionPoolCrash`closure #1 in ConnectionPool.runTimer<τ_0_0>(self=0x0000600002c94000, timer=_ConnectionPoolModule.PoolStateMachine<PostgresNIO.PostgresConnection, _ConnectionPoolModule.ConnectionIDGenerator, Swift.Int, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, Swift.CheckedContinuation<(), Swift.Never>>.Timer @ 0x0000600002690a50) at ConnectionPool.swift:507
    frame #13: 0x00000001001c5d14 ConnectionPoolCrash`partial apply for closure #1 in ConnectionPool.runTimer<τ_0_0>(_:in:) at <compiler-generated>:0
    frame #14: 0x00000001001ccf24 ConnectionPoolCrash`thunk for @escaping @callee_guaranteed @Sendable @async () -> () at <compiler-generated>:0
    frame #15: 0x00000001001cd074 ConnectionPoolCrash`partial apply for thunk for @escaping @callee_guaranteed @Sendable @async () -> () at <compiler-generated>:0
  thread #25, queue = 'com.apple.root.default-qos.cooperative'
    frame #0: 0x0000000192318ea4 libsystem_kernel.dylib`__psynch_mutexwait + 8
    frame #1: 0x00000001025bbe10 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 100
    frame #2: 0x00000001025bbd2c libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 248
    frame #3: 0x00000001001d8a18 ConnectionPoolCrash`static LockOperations.lock(mutex=0x600002f9c0c0, self=_ConnectionPoolModule.LockOperations) at NIOLock.swift:80:19
    frame #4: 0x00000001001d95c0 ConnectionPoolCrash`closure #1 in LockStorage.withLockedValue<τ_0_0>(valuePtr=0x600002f9c010, lockPtr=0x600002f9c0c0, mutate=0x1001bcf78) at NIOLock.swift:174:28
    frame #5: 0x00000001001d9bfc ConnectionPoolCrash`partial apply for closure #1 in LockStorage.withLockedValue<τ_0_0>(_:) at <compiler-generated>:0
    frame #6: 0x00000001a21815a8 libswiftCore.dylib`Swift.ManagedBuffer.withUnsafeMutablePointers<τ_0_0>((Swift.UnsafeMutablePointer<τ_0_0>, Swift.UnsafeMutablePointer<τ_0_1>) throws -> τ_1_0) throws -> τ_1_0 + 180
    frame #7: 0x00000001001d9524 ConnectionPoolCrash`LockStorage.withLockedValue<τ_0_0>(mutate=0x1001bcf78, self=0x0000600002f9c000) at NIOLock.swift:173:18
    frame #8: 0x00000001001da348 ConnectionPoolCrash`NIOLockedValueBox.withLockedValue<τ_0_0>(mutate=0x1001bcf78, self=_ConnectionPoolModule.NIOLockedValueBox<_ConnectionPoolModule.ConnectionPool<PostgresNIO.PostgresConnection, Swift.Int, _ConnectionPoolModule.ConnectionIDGenerator, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, PostgresNIO.PostgresKeepAliveBehavor, PostgresNIO.PostgresClientMetrics, Swift.ContinuousClock>.State> @ 0x000000016ff125f8) at NIOLockedValueBox.swift:42:34
    frame #9: 0x00000001001b5838 ConnectionPoolCrash`ConnectionPool.modifyStateAndRunActions(closure=0x1001bd6c8, self=0x0000600002c94000) at ConnectionPool.swift:355:37
    frame #10: 0x00000001001b5dd0 ConnectionPoolCrash`ConnectionPool.leaseConnection(request=_ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection> @ 0x000000016ff12cd0, self=0x0000600002c94000) at ConnectionPool.swift:231:14
    frame #11: 0x00000001001d21c0 ConnectionPoolCrash`closure #1 in closure #1 in ConnectionPool<>.leaseConnection(continuation=(canary = 0x0000600001de4390), requestID=25, self=0x0000600002c94000) at ConnectionRequest.swift:61:22
    frame #12: 0x00000002589fb3c8 libswift_Concurrency.dylib`merged closure #1 (Swift.UnsafeContinuation<τ_0_0, Swift.Never>) -> () in Swift.withCheckedContinuation<τ_0_0>(function: Swift.String, _: (Swift.CheckedContinuation<τ_0_0, Swift.Never>) -> ()) async -> τ_0_0 + 116
    frame #13: 0x00000002589fb414 libswift_Concurrency.dylib`merged partial apply forwarder for closure #1 (Swift.UnsafeContinuation<τ_0_0, Swift.Never>) -> () in Swift.withCheckedContinuation<τ_0_0>(function: Swift.String, _: (Swift.CheckedContinuation<τ_0_0, Swift.Never>) -> ()) async -> τ_0_0 + 28
    frame #14: 0x00000002589fb49c libswift_Concurrency.dylib`Swift.withUnsafeThrowingContinuation<τ_0_0>((Swift.UnsafeContinuation<τ_0_0, Swift.Error>) -> ()) async throws -> τ_0_0 + 128
    frame #15: 0x00000002589fb244 libswift_Concurrency.dylib`(1) await resume partial function for Swift.withCheckedThrowingContinuation<τ_0_0>(function: Swift.String, _: (Swift.CheckedContinuation<τ_0_0, Swift.Error>) -> ()) async throws -> τ_0_0
    frame #16: 0x00000001001d1dec ConnectionPoolCrash`closure #1 in ConnectionPool<>.leaseConnection(requestID=25, self=0x0000600002c94000) at ConnectionRequest.swift:55
    frame #17: 0x00000001001d200c ConnectionPoolCrash`partial apply for closure #1 in ConnectionPool<>.leaseConnection() at <compiler-generated>:0
    frame #18: 0x0000000258a137f0 libswift_Concurrency.dylib`(1) await resume partial function for Swift.withTaskCancellationHandler<τ_0_0>(operation: () async throws -> τ_0_0, onCancel: @Sendable () -> ()) async throws -> τ_0_0
    frame #19: 0x00000001001bbbd0 ConnectionPoolCrash`withTaskCancellationHandler<T>(operation:onCancel:) at <compiler-generated>:0
    frame #20: 0x00000001001d19b4 ConnectionPoolCrash`ConnectionPool<>.leaseConnection(self=0x0000600002c94000) at ConnectionRequest.swift:50
    frame #21: 0x0000000100124630 ConnectionPoolCrash`PostgresClient.leaseConnection(self=0x00006000037905a0) at PostgresClient.swift:433
    frame #22: 0x0000000100123fb0 ConnectionPoolCrash`PostgresClient.withConnection<Result>(closure=0x100fcb2c8, self=0x00006000037905a0) at PostgresClient.swift:300
    frame #23: 0x0000000100009388 ConnectionPoolCrash`closure #1 in closure #1 in runOnce #1 (client=0x00006000037905a0, logger=Logging.Logger @ 0x0000600003790b58, idleTimeout=60) in pgsql() at pgsql.swift:55
    frame #24: 0x000000010000a898 ConnectionPoolCrash`partial apply for closure #1 in closure #1 in runOnce #1 () in pgsql() at <compiler-generated>:0
  thread #26, queue = 'com.apple.root.default-qos.cooperative'
    frame #0: 0x0000000192318ea4 libsystem_kernel.dylib`__psynch_mutexwait + 8
    frame #1: 0x00000001025bbe10 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 100
    frame #2: 0x00000001025bbd2c libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 248
    frame #3: 0x00000001001d8a18 ConnectionPoolCrash`static LockOperations.lock(mutex=0x600002f9c0c0, self=_ConnectionPoolModule.LockOperations) at NIOLock.swift:80:19
    frame #4: 0x00000001001d95c0 ConnectionPoolCrash`closure #1 in LockStorage.withLockedValue<τ_0_0>(valuePtr=0x600002f9c010, lockPtr=0x600002f9c0c0, mutate=0x1001cdb88) at NIOLock.swift:174:28
    frame #5: 0x00000001001d9bfc ConnectionPoolCrash`partial apply for closure #1 in LockStorage.withLockedValue<τ_0_0>(_:) at <compiler-generated>:0
    frame #6: 0x00000001a21815a8 libswiftCore.dylib`Swift.ManagedBuffer.withUnsafeMutablePointers<τ_0_0>((Swift.UnsafeMutablePointer<τ_0_0>, Swift.UnsafeMutablePointer<τ_0_1>) throws -> τ_1_0) throws -> τ_1_0 + 180
    frame #7: 0x00000001001d9524 ConnectionPoolCrash`LockStorage.withLockedValue<τ_0_0>(mutate=0x1001cdb88, self=0x0000600002f9c000) at NIOLock.swift:173:18
    frame #8: 0x00000001001da348 ConnectionPoolCrash`NIOLockedValueBox.withLockedValue<τ_0_0>(mutate=0x1001cdb88, self=_ConnectionPoolModule.NIOLockedValueBox<_ConnectionPoolModule.ConnectionPool<PostgresNIO.PostgresConnection, Swift.Int, _ConnectionPoolModule.ConnectionIDGenerator, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, PostgresNIO.PostgresKeepAliveBehavor, PostgresNIO.PostgresClientMetrics, Swift.ContinuousClock>.State> @ 0x000000016ff9eb28) at NIOLockedValueBox.swift:42:34
    frame #9: 0x00000001001c6960 ConnectionPoolCrash`closure #1 in closure #1 in ConnectionPool.runTimer<τ_0_0>(taskGroup=(_group = 0x0000000129812040 -> 0x000000026e872208 libswift_Concurrency.dylib`vtable for (anonymous namespace)::AccumulatingTaskGroup + 16), self=0x0000600002c94000, timer=_ConnectionPoolModule.PoolStateMachine<PostgresNIO.PostgresConnection, _ConnectionPoolModule.ConnectionIDGenerator, Swift.Int, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, Swift.CheckedContinuation<(), Swift.Never>>.Timer @ 0x0000000129810ed0) at ConnectionPool.swift:538:48
    frame #10: 0x00000001001cd314 ConnectionPoolCrash`partial apply for closure #1 in closure #1 in ConnectionPool.runTimer<τ_0_0>(_:in:) at <compiler-generated>:0
    frame #11: 0x0000000258a13ac8 libswift_Concurrency.dylib`(1) await resume partial function for Swift.withTaskGroup<τ_0_0, τ_0_1>(of: τ_0_0.Type, returning: τ_0_1.Type, body: (inout Swift.TaskGroup<τ_0_0>) async -> τ_0_1) async -> τ_0_1
    frame #12: 0x00000001001c5740 ConnectionPoolCrash`closure #1 in ConnectionPool.runTimer<τ_0_0>(self=0x0000600002c94000, timer=_ConnectionPoolModule.PoolStateMachine<PostgresNIO.PostgresConnection, _ConnectionPoolModule.ConnectionIDGenerator, Swift.Int, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, Swift.CheckedContinuation<(), Swift.Never>>.Timer @ 0x000060000268ca50) at ConnectionPool.swift:507
    frame #13: 0x00000001001c5d14 ConnectionPoolCrash`partial apply for closure #1 in ConnectionPool.runTimer<τ_0_0>(_:in:) at <compiler-generated>:0
    frame #14: 0x00000001001ccf24 ConnectionPoolCrash`thunk for @escaping @callee_guaranteed @Sendable @async () -> () at <compiler-generated>:0
    frame #15: 0x00000001001cd074 ConnectionPoolCrash`partial apply for thunk for @escaping @callee_guaranteed @Sendable @async () -> () at <compiler-generated>:0
  thread #27, queue = 'com.apple.root.default-qos.cooperative'
    frame #0: 0x0000000192318ea4 libsystem_kernel.dylib`__psynch_mutexwait + 8
    frame #1: 0x00000001025bbe10 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 100
    frame #2: 0x00000001025bbd2c libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 248
    frame #3: 0x00000001001d8a18 ConnectionPoolCrash`static LockOperations.lock(mutex=0x600002f9c0c0, self=_ConnectionPoolModule.LockOperations) at NIOLock.swift:80:19
    frame #4: 0x00000001001d95c0 ConnectionPoolCrash`closure #1 in LockStorage.withLockedValue<τ_0_0>(valuePtr=0x600002f9c010, lockPtr=0x600002f9c0c0, mutate=0x1001cdb88) at NIOLock.swift:174:28
    frame #5: 0x00000001001d9bfc ConnectionPoolCrash`partial apply for closure #1 in LockStorage.withLockedValue<τ_0_0>(_:) at <compiler-generated>:0
    frame #6: 0x00000001a21815a8 libswiftCore.dylib`Swift.ManagedBuffer.withUnsafeMutablePointers<τ_0_0>((Swift.UnsafeMutablePointer<τ_0_0>, Swift.UnsafeMutablePointer<τ_0_1>) throws -> τ_1_0) throws -> τ_1_0 + 180
    frame #7: 0x00000001001d9524 ConnectionPoolCrash`LockStorage.withLockedValue<τ_0_0>(mutate=0x1001cdb88, self=0x0000600002f9c000) at NIOLock.swift:173:18
    frame #8: 0x00000001001da348 ConnectionPoolCrash`NIOLockedValueBox.withLockedValue<τ_0_0>(mutate=0x1001cdb88, self=_ConnectionPoolModule.NIOLockedValueBox<_ConnectionPoolModule.ConnectionPool<PostgresNIO.PostgresConnection, Swift.Int, _ConnectionPoolModule.ConnectionIDGenerator, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, PostgresNIO.PostgresKeepAliveBehavor, PostgresNIO.PostgresClientMetrics, Swift.ContinuousClock>.State> @ 0x000000017002ab28) at NIOLockedValueBox.swift:42:34
    frame #9: 0x00000001001c6960 ConnectionPoolCrash`closure #1 in closure #1 in ConnectionPool.runTimer<τ_0_0>(taskGroup=(_group = 0x000000011782b440 -> 0x000000026e872208 libswift_Concurrency.dylib`vtable for (anonymous namespace)::AccumulatingTaskGroup + 16), self=0x0000600002c94000, timer=_ConnectionPoolModule.PoolStateMachine<PostgresNIO.PostgresConnection, _ConnectionPoolModule.ConnectionIDGenerator, Swift.Int, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, Swift.CheckedContinuation<(), Swift.Never>>.Timer @ 0x000000011782b2d0) at ConnectionPool.swift:538:48
    frame #10: 0x00000001001cd314 ConnectionPoolCrash`partial apply for closure #1 in closure #1 in ConnectionPool.runTimer<τ_0_0>(_:in:) at <compiler-generated>:0
    frame #11: 0x0000000258a13ac8 libswift_Concurrency.dylib`(1) await resume partial function for Swift.withTaskGroup<τ_0_0, τ_0_1>(of: τ_0_0.Type, returning: τ_0_1.Type, body: (inout Swift.TaskGroup<τ_0_0>) async -> τ_0_1) async -> τ_0_1
    frame #12: 0x00000001001c5740 ConnectionPoolCrash`closure #1 in ConnectionPool.runTimer<τ_0_0>(self=0x0000600002c94000, timer=_ConnectionPoolModule.PoolStateMachine<PostgresNIO.PostgresConnection, _ConnectionPoolModule.ConnectionIDGenerator, Swift.Int, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, Swift.CheckedContinuation<(), Swift.Never>>.Timer @ 0x000060000269cc90) at ConnectionPool.swift:507
    frame #13: 0x00000001001c5d14 ConnectionPoolCrash`partial apply for closure #1 in ConnectionPool.runTimer<τ_0_0>(_:in:) at <compiler-generated>:0
    frame #14: 0x00000001001ccf24 ConnectionPoolCrash`thunk for @escaping @callee_guaranteed @Sendable @async () -> () at <compiler-generated>:0
    frame #15: 0x00000001001cd074 ConnectionPoolCrash`partial apply for thunk for @escaping @callee_guaranteed @Sendable @async () -> () at <compiler-generated>:0
  thread #28, queue = 'com.apple.root.default-qos.cooperative'
    frame #0: 0x0000000192318ea4 libsystem_kernel.dylib`__psynch_mutexwait + 8
    frame #1: 0x00000001025bbe10 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 100
    frame #2: 0x00000001025bbd2c libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 248
    frame #3: 0x00000001001d8a18 ConnectionPoolCrash`static LockOperations.lock(mutex=0x600002f9c0c0, self=_ConnectionPoolModule.LockOperations) at NIOLock.swift:80:19
    frame #4: 0x00000001001d95c0 ConnectionPoolCrash`closure #1 in LockStorage.withLockedValue<τ_0_0>(valuePtr=0x600002f9c010, lockPtr=0x600002f9c0c0, mutate=0x1001cdb88) at NIOLock.swift:174:28
    frame #5: 0x00000001001d9bfc ConnectionPoolCrash`partial apply for closure #1 in LockStorage.withLockedValue<τ_0_0>(_:) at <compiler-generated>:0
    frame #6: 0x00000001a21815a8 libswiftCore.dylib`Swift.ManagedBuffer.withUnsafeMutablePointers<τ_0_0>((Swift.UnsafeMutablePointer<τ_0_0>, Swift.UnsafeMutablePointer<τ_0_1>) throws -> τ_1_0) throws -> τ_1_0 + 180
    frame #7: 0x00000001001d9524 ConnectionPoolCrash`LockStorage.withLockedValue<τ_0_0>(mutate=0x1001cdb88, self=0x0000600002f9c000) at NIOLock.swift:173:18
    frame #8: 0x00000001001da348 ConnectionPoolCrash`NIOLockedValueBox.withLockedValue<τ_0_0>(mutate=0x1001cdb88, self=_ConnectionPoolModule.NIOLockedValueBox<_ConnectionPoolModule.ConnectionPool<PostgresNIO.PostgresConnection, Swift.Int, _ConnectionPoolModule.ConnectionIDGenerator, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, PostgresNIO.PostgresKeepAliveBehavor, PostgresNIO.PostgresClientMetrics, Swift.ContinuousClock>.State> @ 0x00000001700b6b28) at NIOLockedValueBox.swift:42:34
    frame #9: 0x00000001001c6960 ConnectionPoolCrash`closure #1 in closure #1 in ConnectionPool.runTimer<τ_0_0>(taskGroup=(_group = 0x0000000129822640 -> 0x000000026e872208 libswift_Concurrency.dylib`vtable for (anonymous namespace)::AccumulatingTaskGroup + 16), self=0x0000600002c94000, timer=_ConnectionPoolModule.PoolStateMachine<PostgresNIO.PostgresConnection, _ConnectionPoolModule.ConnectionIDGenerator, Swift.Int, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, Swift.CheckedContinuation<(), Swift.Never>>.Timer @ 0x00000001280332d0) at ConnectionPool.swift:538:48
    frame #10: 0x00000001001cd314 ConnectionPoolCrash`partial apply for closure #1 in closure #1 in ConnectionPool.runTimer<τ_0_0>(_:in:) at <compiler-generated>:0
    frame #11: 0x0000000258a13ac8 libswift_Concurrency.dylib`(1) await resume partial function for Swift.withTaskGroup<τ_0_0, τ_0_1>(of: τ_0_0.Type, returning: τ_0_1.Type, body: (inout Swift.TaskGroup<τ_0_0>) async -> τ_0_1) async -> τ_0_1
    frame #12: 0x00000001001c5740 ConnectionPoolCrash`closure #1 in ConnectionPool.runTimer<τ_0_0>(self=0x0000600002c94000, timer=_ConnectionPoolModule.PoolStateMachine<PostgresNIO.PostgresConnection, _ConnectionPoolModule.ConnectionIDGenerator, Swift.Int, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, Swift.CheckedContinuation<(), Swift.Never>>.Timer @ 0x0000600002694690) at ConnectionPool.swift:507
    frame #13: 0x00000001001c5d14 ConnectionPoolCrash`partial apply for closure #1 in ConnectionPool.runTimer<τ_0_0>(_:in:) at <compiler-generated>:0
    frame #14: 0x00000001001ccf24 ConnectionPoolCrash`thunk for @escaping @callee_guaranteed @Sendable @async () -> () at <compiler-generated>:0
    frame #15: 0x00000001001cd074 ConnectionPoolCrash`partial apply for thunk for @escaping @callee_guaranteed @Sendable @async () -> () at <compiler-generated>:0
  thread #29, queue = 'com.apple.root.default-qos.cooperative'
    frame #0: 0x0000000192318ea4 libsystem_kernel.dylib`__psynch_mutexwait + 8
    frame #1: 0x00000001025bbe10 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 100
    frame #2: 0x00000001025bbd2c libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 248
    frame #3: 0x00000001001d8a18 ConnectionPoolCrash`static LockOperations.lock(mutex=0x600002f9c0c0, self=_ConnectionPoolModule.LockOperations) at NIOLock.swift:80:19
    frame #4: 0x00000001001d95c0 ConnectionPoolCrash`closure #1 in LockStorage.withLockedValue<τ_0_0>(valuePtr=0x600002f9c010, lockPtr=0x600002f9c0c0, mutate=0x1001cdb88) at NIOLock.swift:174:28
    frame #5: 0x00000001001d9bfc ConnectionPoolCrash`partial apply for closure #1 in LockStorage.withLockedValue<τ_0_0>(_:) at <compiler-generated>:0
    frame #6: 0x00000001a21815a8 libswiftCore.dylib`Swift.ManagedBuffer.withUnsafeMutablePointers<τ_0_0>((Swift.UnsafeMutablePointer<τ_0_0>, Swift.UnsafeMutablePointer<τ_0_1>) throws -> τ_1_0) throws -> τ_1_0 + 180
    frame #7: 0x00000001001d9524 ConnectionPoolCrash`LockStorage.withLockedValue<τ_0_0>(mutate=0x1001cdb88, self=0x0000600002f9c000) at NIOLock.swift:173:18
    frame #8: 0x00000001001da348 ConnectionPoolCrash`NIOLockedValueBox.withLockedValue<τ_0_0>(mutate=0x1001cdb88, self=_ConnectionPoolModule.NIOLockedValueBox<_ConnectionPoolModule.ConnectionPool<PostgresNIO.PostgresConnection, Swift.Int, _ConnectionPoolModule.ConnectionIDGenerator, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, PostgresNIO.PostgresKeepAliveBehavor, PostgresNIO.PostgresClientMetrics, Swift.ContinuousClock>.State> @ 0x0000000170142b28) at NIOLockedValueBox.swift:42:34
    frame #9: 0x00000001001c6960 ConnectionPoolCrash`closure #1 in closure #1 in ConnectionPool.runTimer<τ_0_0>(taskGroup=(_group = 0x0000000127819c40 -> 0x000000026e872208 libswift_Concurrency.dylib`vtable for (anonymous namespace)::AccumulatingTaskGroup + 16), self=0x0000600002c94000, timer=_ConnectionPoolModule.PoolStateMachine<PostgresNIO.PostgresConnection, _ConnectionPoolModule.ConnectionIDGenerator, Swift.Int, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, Swift.CheckedContinuation<(), Swift.Never>>.Timer @ 0x00000001278280d0) at ConnectionPool.swift:538:48
    frame #10: 0x00000001001cd314 ConnectionPoolCrash`partial apply for closure #1 in closure #1 in ConnectionPool.runTimer<τ_0_0>(_:in:) at <compiler-generated>:0
    frame #11: 0x0000000258a13ac8 libswift_Concurrency.dylib`(1) await resume partial function for Swift.withTaskGroup<τ_0_0, τ_0_1>(of: τ_0_0.Type, returning: τ_0_1.Type, body: (inout Swift.TaskGroup<τ_0_0>) async -> τ_0_1) async -> τ_0_1
    frame #12: 0x00000001001c5740 ConnectionPoolCrash`closure #1 in ConnectionPool.runTimer<τ_0_0>(self=0x0000600002c94000, timer=_ConnectionPoolModule.PoolStateMachine<PostgresNIO.PostgresConnection, _ConnectionPoolModule.ConnectionIDGenerator, Swift.Int, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, Swift.CheckedContinuation<(), Swift.Never>>.Timer @ 0x0000600002698b10) at ConnectionPool.swift:507
    frame #13: 0x00000001001c5d14 ConnectionPoolCrash`partial apply for closure #1 in ConnectionPool.runTimer<τ_0_0>(_:in:) at <compiler-generated>:0
    frame #14: 0x00000001001ccf24 ConnectionPoolCrash`thunk for @escaping @callee_guaranteed @Sendable @async () -> () at <compiler-generated>:0
    frame #15: 0x00000001001cd074 ConnectionPoolCrash`partial apply for thunk for @escaping @callee_guaranteed @Sendable @async () -> () at <compiler-generated>:0
  thread #30, queue = 'nio.transportservices.eventloop.taskqueue'
    frame #0: 0x0000000192318ea4 libsystem_kernel.dylib`__psynch_mutexwait + 8
    frame #1: 0x00000001025bbe10 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 100
    frame #2: 0x00000001025bbd2c libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 248
    frame #3: 0x00000001921fc73c libsystem_c.dylib`flockfile + 40
    frame #4: 0x0000000100263148 ConnectionPoolCrash`closure #1 in StdioOutputStream.write(utf8Bytes=277 values (0x101f053c0), self=Logging.StdioOutputStream @ 0x00000001701cc7c0) at Logging.swift:1202:13
    frame #5: 0x0000000100268abc ConnectionPoolCrash`partial apply for closure #1 in StdioOutputStream.write(_:) at <compiler-generated>:0
    frame #6: 0x00000001a22374b0 libswiftCore.dylib`Swift.String.UTF8View.withContiguousStorageIfAvailable<τ_0_0>((Swift.UnsafeBufferPointer<Swift.UInt8>) throws -> τ_0_0) throws -> Swift.Optional<τ_0_0> + 108
    frame #7: 0x0000000100262f98 ConnectionPoolCrash`StdioOutputStream.write(string="2024-05-07T19:47:34+0200 debug connection-pool-crash : psql_connection_id=12 psql_error=PSQLError – Generic description to prevent accidental leakage of sensitive data. For debugging details, use `String(reflecting: error)`. [PostgresNIO] Cleaning up and closing connection.\n", self=Logging.StdioOutputStream @ 0x00000001701cc8d0) at Logging.swift:1196:37
    frame #8: 0x0000000100263760 ConnectionPoolCrash`protocol witness for TextOutputStream.write(_:) in conformance StdioOutputStream at <compiler-generated>:0
    frame #9: 0x00000001002649bc ConnectionPoolCrash`StreamLogHandler.log(level=debug, message=(value = "Cleaning up and closing connection."), explicitMetadata=1 key/value pair, source="PostgresNIO", file="PostgresNIO/PostgresChannelHandler.swift", function="closeConnectionAndCleanup(_:context:)", line=567, self=Logging.StreamLogHandler @ 0x0000600003d80410) at Logging.swift:1352:16
    frame #10: 0x0000000100266150 ConnectionPoolCrash`protocol witness for LogHandler.log(level:message:metadata:source:file:function:line:) in conformance StreamLogHandler at <compiler-generated>:0
    frame #11: 0x000000010025bb8c ConnectionPoolCrash`Logger.log(level=debug, message=0x00000001000b2dd4 ConnectionPoolCrash`partial apply forwarder for implicit closure #1 () -> Logging.Logger.Message in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, metadata=0x00000001000b2e24 ConnectionPoolCrash`partial apply forwarder for implicit closure #2 () -> Swift.Optional<Swift.Dictionary<Swift.String, Logging.Logger.MetadataValue>> in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, source=0x00000001000b2e50 ConnectionPoolCrash`partial apply forwarder for implicit closure #3 () -> Swift.Optional<Swift.String> in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, file="PostgresNIO/PostgresChannelHandler.swift", function="closeConnectionAndCleanup(_:context:)", line=567, self=Logging.Logger @ 0x00000001701cd178) at Logging.swift:87:26
    frame #12: 0x00000001000b2da4 ConnectionPoolCrash`Logger.debug(message=0x00000001000f757c ConnectionPoolCrash`implicit closure #1 () -> Logging.Logger.Message in PostgresNIO.PostgresChannelHandler.closeConnectionAndCleanup(_: PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext, context: NIOCore.ChannelHandlerContext) -> () at <compiler-generated>, metadata=0x00000001000fa4e8 ConnectionPoolCrash`partial apply forwarder for implicit closure #2 () -> PostgresNIO.PSQLLoggingMetadata in PostgresNIO.PostgresChannelHandler.closeConnectionAndCleanup(_: PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext, context: NIOCore.ChannelHandlerContext) -> () at <compiler-generated>, source=0x00000001000f7728 ConnectionPoolCrash`implicit closure #3 () -> Swift.Optional<Swift.String> in PostgresNIO.PostgresChannelHandler.closeConnectionAndCleanup(_: PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext, context: NIOCore.ChannelHandlerContext) -> () at <compiler-generated>, file="PostgresNIO/PostgresChannelHandler.swift", function="closeConnectionAndCleanup(_:context:)", line=567, self=Logging.Logger @ 0x00000001701cd178) at Logging+PSQL.swift:99:14
    frame #13: 0x00000001000f42c4 ConnectionPoolCrash`PostgresChannelHandler.closeConnectionAndCleanup(cleanup=PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext @ 0x00000001701cd1c0, context=0x0000600003791440, self=0x000000012900d480) at PostgresChannelHandler.swift:567:21
    frame #14: 0x00000001000ef6e4 ConnectionPoolCrash`PostgresChannelHandler.run(action=closeConnectionAndCleanup, context=0x0000600003791440, self=0x000000012900d480) at PostgresChannelHandler.swift:345:18
    frame #15: 0x00000001000f2b3c ConnectionPoolCrash`PostgresChannelHandler.close(context=0x0000600003791440, mode=all, promise=nil, self=0x000000012900d480) at PostgresChannelHandler.swift:273:14
    frame #16: 0x00000001000f8bec ConnectionPoolCrash`protocol witness for _ChannelOutboundHandler.close(context:mode:promise:) in conformance PostgresChannelHandler at <compiler-generated>:0
    frame #17: 0x0000000100392584 ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x0000600003791440) at ChannelPipeline.swift:1856:29
    frame #18: 0x00000001003925ec ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x0000600003791620) at ChannelPipeline.swift:1858:24
    frame #19: 0x0000000100390dc4 ConnectionPoolCrash`ChannelPipeline.close0(mode=all, promise=nil, self=0x0000600003099fe0) at ChannelPipeline.swift:827:30
    frame #20: 0x0000000100390eb4 ConnectionPoolCrash`closure #1 in ChannelPipeline.close(self=0x0000600003099fe0, mode=all, promise=nil) at ChannelPipeline.swift:730:22
    frame #21: 0x0000000100556914 ConnectionPoolCrash`thunk for @escaping @callee_guaranteed @Sendable () -> () at <compiler-generated>:0
    frame #22: 0x000000010271eb0c libdispatch.dylib`_dispatch_block_async_invoke2 + 148
    frame #23: 0x000000010270aba4 libdispatch.dylib`_dispatch_client_callout + 20
    frame #24: 0x0000000102713d88 libdispatch.dylib`_dispatch_lane_serial_drain + 864
    frame #25: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #26: 0x0000000102713b98 libdispatch.dylib`_dispatch_lane_serial_drain + 368
    frame #27: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #28: 0x0000000102724958 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 652
    frame #29: 0x0000000102723c30 libdispatch.dylib`_dispatch_workloop_worker_thread + 444
    frame #30: 0x00000001025b7d40 libsystem_pthread.dylib`_pthread_wqthread + 288
* thread #31, queue = 'com.apple.root.default-qos.cooperative', stop reason = Precondition failed
    frame #0: 0x00000001a23b8890 libswiftCore.dylib`_swift_runtime_on_report
    frame #1: 0x00000001a2477b10 libswiftCore.dylib`_swift_stdlib_reportFatalErrorInFile + 208
    frame #2: 0x00000001a2049d94 libswiftCore.dylib`closure #1 (Swift.UnsafeBufferPointer<Swift.UInt8>) -> () in closure #1 (Swift.UnsafeBufferPointer<Swift.UInt8>) -> () in Swift._assertionFailure(_: Swift.StaticString, _: Swift.String, file: Swift.StaticString, line: Swift.UInt, flags: Swift.UInt32) -> Swift.Never + 104
    frame #3: 0x00000001a204901c libswiftCore.dylib`Swift._assertionFailure(_: Swift.StaticString, _: Swift.String, file: Swift.StaticString, line: Swift.UInt, flags: Swift.UInt32) -> Swift.Never + 584
    frame #4: 0x000000010022c594 ConnectionPoolCrash`PoolStateMachine.connectionKeepAliveTimerTriggered(connectionID=4, self=_ConnectionPoolModule.PoolStateMachine<PostgresNIO.PostgresConnection, _ConnectionPoolModule.ConnectionIDGenerator, Swift.Int, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, Swift.CheckedContinuation<(), Swift.Never>> @ 0x0000600002f9c010) at PoolStateMachine.swift:360:9
    frame #5: 0x000000010022b0a4 ConnectionPoolCrash`PoolStateMachine.timerTriggered(timer=_ConnectionPoolModule.PoolStateMachine<PostgresNIO.PostgresConnection, _ConnectionPoolModule.ConnectionIDGenerator, Swift.Int, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, Swift.CheckedContinuation<(), Swift.Never>>.Timer @ 0x000000012982fee0, self=_ConnectionPoolModule.PoolStateMachine<PostgresNIO.PostgresConnection, _ConnectionPoolModule.ConnectionIDGenerator, Swift.Int, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, Swift.CheckedContinuation<(), Swift.Never>> @ 0x0000600002f9c010) at PoolStateMachine.swift:309:25
    frame #6: 0x00000001001c8328 ConnectionPoolCrash`closure #3 in closure #1 in closure #1 in ConnectionPool.runTimer<τ_0_0>(state=_ConnectionPoolModule.ConnectionPool<PostgresNIO.PostgresConnection, Swift.Int, _ConnectionPoolModule.ConnectionIDGenerator, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, PostgresNIO.PostgresKeepAliveBehavor, PostgresNIO.PostgresClientMetrics, Swift.ContinuousClock>.State @ 0x0000600002f9c010, timer=_ConnectionPoolModule.PoolStateMachine<PostgresNIO.PostgresConnection, _ConnectionPoolModule.ConnectionIDGenerator, Swift.Int, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, Swift.CheckedContinuation<(), Swift.Never>>.Timer @ 0x000000012982fee0) at ConnectionPool.swift:539:44
    frame #7: 0x00000001001cdc2c ConnectionPoolCrash`partial apply for closure #3 in closure #1 in closure #1 in ConnectionPool.runTimer<τ_0_0>(_:in:) at <compiler-generated>:0
    frame #8: 0x00000001001d95d4 ConnectionPoolCrash`closure #1 in LockStorage.withLockedValue<τ_0_0>(valuePtr=0x600002f9c010, lockPtr=0x600002f9c0c0, mutate=0x1001cdb88) at NIOLock.swift:176:24
    frame #9: 0x00000001001d9bfc ConnectionPoolCrash`partial apply for closure #1 in LockStorage.withLockedValue<τ_0_0>(_:) at <compiler-generated>:0
    frame #10: 0x00000001a21815a8 libswiftCore.dylib`Swift.ManagedBuffer.withUnsafeMutablePointers<τ_0_0>((Swift.UnsafeMutablePointer<τ_0_0>, Swift.UnsafeMutablePointer<τ_0_1>) throws -> τ_1_0) throws -> τ_1_0 + 180
    frame #11: 0x00000001001d9524 ConnectionPoolCrash`LockStorage.withLockedValue<τ_0_0>(mutate=0x1001cdb88, self=0x0000600002f9c000) at NIOLock.swift:173:18
    frame #12: 0x00000001001da348 ConnectionPoolCrash`NIOLockedValueBox.withLockedValue<τ_0_0>(mutate=0x1001cdb88, self=_ConnectionPoolModule.NIOLockedValueBox<_ConnectionPoolModule.ConnectionPool<PostgresNIO.PostgresConnection, Swift.Int, _ConnectionPoolModule.ConnectionIDGenerator, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, PostgresNIO.PostgresKeepAliveBehavor, PostgresNIO.PostgresClientMetrics, Swift.ContinuousClock>.State> @ 0x000000017025ab28) at NIOLockedValueBox.swift:42:34
    frame #13: 0x00000001001c6960 ConnectionPoolCrash`closure #1 in closure #1 in ConnectionPool.runTimer<τ_0_0>(taskGroup=(_group = 0x000000012982f640 -> 0x000000026e872208 libswift_Concurrency.dylib`vtable for (anonymous namespace)::AccumulatingTaskGroup + 16), self=0x0000600002c94000, timer=_ConnectionPoolModule.PoolStateMachine<PostgresNIO.PostgresConnection, _ConnectionPoolModule.ConnectionIDGenerator, Swift.Int, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, Swift.CheckedContinuation<(), Swift.Never>>.Timer @ 0x00000001178304d0) at ConnectionPool.swift:538:48
    frame #14: 0x00000001001cd314 ConnectionPoolCrash`partial apply for closure #1 in closure #1 in ConnectionPool.runTimer<τ_0_0>(_:in:) at <compiler-generated>:0
    frame #15: 0x0000000258a13ac8 libswift_Concurrency.dylib`(1) await resume partial function for Swift.withTaskGroup<τ_0_0, τ_0_1>(of: τ_0_0.Type, returning: τ_0_1.Type, body: (inout Swift.TaskGroup<τ_0_0>) async -> τ_0_1) async -> τ_0_1
  * frame #16: 0x00000001001c5740 ConnectionPoolCrash`closure #1 in ConnectionPool.runTimer<τ_0_0>(self=0x0000600002c94000, timer=_ConnectionPoolModule.PoolStateMachine<PostgresNIO.PostgresConnection, _ConnectionPoolModule.ConnectionIDGenerator, Swift.Int, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, Swift.CheckedContinuation<(), Swift.Never>>.Timer @ 0x000060000269d050) at ConnectionPool.swift:507
    frame #17: 0x00000001001c5d14 ConnectionPoolCrash`partial apply for closure #1 in ConnectionPool.runTimer<τ_0_0>(_:in:) at <compiler-generated>:0
    frame #18: 0x00000001001ccf24 ConnectionPoolCrash`thunk for @escaping @callee_guaranteed @Sendable @async () -> () at <compiler-generated>:0
    frame #19: 0x00000001001cd074 ConnectionPoolCrash`partial apply for thunk for @escaping @callee_guaranteed @Sendable @async () -> () at <compiler-generated>:0
  thread #32, queue = 'com.apple.root.default-qos.cooperative'
    frame #0: 0x0000000192318ea4 libsystem_kernel.dylib`__psynch_mutexwait + 8
    frame #1: 0x00000001025bbe10 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 100
    frame #2: 0x00000001025bbd2c libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 248
    frame #3: 0x00000001001d8a18 ConnectionPoolCrash`static LockOperations.lock(mutex=0x600002f9c0c0, self=_ConnectionPoolModule.LockOperations) at NIOLock.swift:80:19
    frame #4: 0x00000001001d95c0 ConnectionPoolCrash`closure #1 in LockStorage.withLockedValue<τ_0_0>(valuePtr=0x600002f9c010, lockPtr=0x600002f9c0c0, mutate=0x1001bcf78) at NIOLock.swift:174:28
    frame #5: 0x00000001001d9bfc ConnectionPoolCrash`partial apply for closure #1 in LockStorage.withLockedValue<τ_0_0>(_:) at <compiler-generated>:0
    frame #6: 0x00000001a21815a8 libswiftCore.dylib`Swift.ManagedBuffer.withUnsafeMutablePointers<τ_0_0>((Swift.UnsafeMutablePointer<τ_0_0>, Swift.UnsafeMutablePointer<τ_0_1>) throws -> τ_1_0) throws -> τ_1_0 + 180
    frame #7: 0x00000001001d9524 ConnectionPoolCrash`LockStorage.withLockedValue<τ_0_0>(mutate=0x1001bcf78, self=0x0000600002f9c000) at NIOLock.swift:173:18
    frame #8: 0x00000001001da348 ConnectionPoolCrash`NIOLockedValueBox.withLockedValue<τ_0_0>(mutate=0x1001bcf78, self=_ConnectionPoolModule.NIOLockedValueBox<_ConnectionPoolModule.ConnectionPool<PostgresNIO.PostgresConnection, Swift.Int, _ConnectionPoolModule.ConnectionIDGenerator, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, PostgresNIO.PostgresKeepAliveBehavor, PostgresNIO.PostgresClientMetrics, Swift.ContinuousClock>.State> @ 0x00000001702e65f8) at NIOLockedValueBox.swift:42:34
    frame #9: 0x00000001001b5838 ConnectionPoolCrash`ConnectionPool.modifyStateAndRunActions(closure=0x1001bd6c8, self=0x0000600002c94000) at ConnectionPool.swift:355:37
    frame #10: 0x00000001001b5dd0 ConnectionPoolCrash`ConnectionPool.leaseConnection(request=_ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection> @ 0x00000001702e6cd0, self=0x0000600002c94000) at ConnectionPool.swift:231:14
    frame #11: 0x00000001001d21c0 ConnectionPoolCrash`closure #1 in closure #1 in ConnectionPool<>.leaseConnection(continuation=(canary = 0x0000600001de9320), requestID=29, self=0x0000600002c94000) at ConnectionRequest.swift:61:22
    frame #12: 0x00000002589fb3c8 libswift_Concurrency.dylib`merged closure #1 (Swift.UnsafeContinuation<τ_0_0, Swift.Never>) -> () in Swift.withCheckedContinuation<τ_0_0>(function: Swift.String, _: (Swift.CheckedContinuation<τ_0_0, Swift.Never>) -> ()) async -> τ_0_0 + 116
    frame #13: 0x00000002589fb414 libswift_Concurrency.dylib`merged partial apply forwarder for closure #1 (Swift.UnsafeContinuation<τ_0_0, Swift.Never>) -> () in Swift.withCheckedContinuation<τ_0_0>(function: Swift.String, _: (Swift.CheckedContinuation<τ_0_0, Swift.Never>) -> ()) async -> τ_0_0 + 28
    frame #14: 0x00000002589fb49c libswift_Concurrency.dylib`Swift.withUnsafeThrowingContinuation<τ_0_0>((Swift.UnsafeContinuation<τ_0_0, Swift.Error>) -> ()) async throws -> τ_0_0 + 128
    frame #15: 0x00000002589fb244 libswift_Concurrency.dylib`(1) await resume partial function for Swift.withCheckedThrowingContinuation<τ_0_0>(function: Swift.String, _: (Swift.CheckedContinuation<τ_0_0, Swift.Error>) -> ()) async throws -> τ_0_0
    frame #16: 0x00000001001d1dec ConnectionPoolCrash`closure #1 in ConnectionPool<>.leaseConnection(requestID=29, self=0x0000600002c94000) at ConnectionRequest.swift:55
    frame #17: 0x00000001001d200c ConnectionPoolCrash`partial apply for closure #1 in ConnectionPool<>.leaseConnection() at <compiler-generated>:0
    frame #18: 0x0000000258a137f0 libswift_Concurrency.dylib`(1) await resume partial function for Swift.withTaskCancellationHandler<τ_0_0>(operation: () async throws -> τ_0_0, onCancel: @Sendable () -> ()) async throws -> τ_0_0
    frame #19: 0x00000001001bbbd0 ConnectionPoolCrash`withTaskCancellationHandler<T>(operation:onCancel:) at <compiler-generated>:0
    frame #20: 0x00000001001d19b4 ConnectionPoolCrash`ConnectionPool<>.leaseConnection(self=0x0000600002c94000) at ConnectionRequest.swift:50
    frame #21: 0x0000000100124630 ConnectionPoolCrash`PostgresClient.leaseConnection(self=0x00006000037905a0) at PostgresClient.swift:433
    frame #22: 0x0000000100123fb0 ConnectionPoolCrash`PostgresClient.withConnection<Result>(closure=0x100fcb2c8, self=0x00006000037905a0) at PostgresClient.swift:300
    frame #23: 0x0000000100009388 ConnectionPoolCrash`closure #1 in closure #1 in runOnce #1 (client=0x00006000037905a0, logger=Logging.Logger @ 0x0000600003790af8, idleTimeout=60) in pgsql() at pgsql.swift:55
    frame #24: 0x000000010000a898 ConnectionPoolCrash`partial apply for closure #1 in closure #1 in runOnce #1 () in pgsql() at <compiler-generated>:0
  thread #33, queue = 'com.apple.root.default-qos.cooperative'
    frame #0: 0x0000000192318ea4 libsystem_kernel.dylib`__psynch_mutexwait + 8
    frame #1: 0x00000001025bbe10 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 100
    frame #2: 0x00000001025bbd2c libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 248
    frame #3: 0x00000001001d8a18 ConnectionPoolCrash`static LockOperations.lock(mutex=0x600002f9c0c0, self=_ConnectionPoolModule.LockOperations) at NIOLock.swift:80:19
    frame #4: 0x00000001001d95c0 ConnectionPoolCrash`closure #1 in LockStorage.withLockedValue<τ_0_0>(valuePtr=0x600002f9c010, lockPtr=0x600002f9c0c0, mutate=0x1001bcf78) at NIOLock.swift:174:28
    frame #5: 0x00000001001d9bfc ConnectionPoolCrash`partial apply for closure #1 in LockStorage.withLockedValue<τ_0_0>(_:) at <compiler-generated>:0
    frame #6: 0x00000001a21815a8 libswiftCore.dylib`Swift.ManagedBuffer.withUnsafeMutablePointers<τ_0_0>((Swift.UnsafeMutablePointer<τ_0_0>, Swift.UnsafeMutablePointer<τ_0_1>) throws -> τ_1_0) throws -> τ_1_0 + 180
    frame #7: 0x00000001001d9524 ConnectionPoolCrash`LockStorage.withLockedValue<τ_0_0>(mutate=0x1001bcf78, self=0x0000600002f9c000) at NIOLock.swift:173:18
    frame #8: 0x00000001001da348 ConnectionPoolCrash`NIOLockedValueBox.withLockedValue<τ_0_0>(mutate=0x1001bcf78, self=_ConnectionPoolModule.NIOLockedValueBox<_ConnectionPoolModule.ConnectionPool<PostgresNIO.PostgresConnection, Swift.Int, _ConnectionPoolModule.ConnectionIDGenerator, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, PostgresNIO.PostgresKeepAliveBehavor, PostgresNIO.PostgresClientMetrics, Swift.ContinuousClock>.State> @ 0x00000001703725f8) at NIOLockedValueBox.swift:42:34
    frame #9: 0x00000001001b5838 ConnectionPoolCrash`ConnectionPool.modifyStateAndRunActions(closure=0x1001bd6c8, self=0x0000600002c94000) at ConnectionPool.swift:355:37
    frame #10: 0x00000001001b5dd0 ConnectionPoolCrash`ConnectionPool.leaseConnection(request=_ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection> @ 0x0000000170372cd0, self=0x0000600002c94000) at ConnectionPool.swift:231:14
    frame #11: 0x00000001001d21c0 ConnectionPoolCrash`closure #1 in closure #1 in ConnectionPool<>.leaseConnection(continuation=(canary = 0x0000600001def0f0), requestID=20, self=0x0000600002c94000) at ConnectionRequest.swift:61:22
    frame #12: 0x00000002589fb3c8 libswift_Concurrency.dylib`merged closure #1 (Swift.UnsafeContinuation<τ_0_0, Swift.Never>) -> () in Swift.withCheckedContinuation<τ_0_0>(function: Swift.String, _: (Swift.CheckedContinuation<τ_0_0, Swift.Never>) -> ()) async -> τ_0_0 + 116
    frame #13: 0x00000002589fb414 libswift_Concurrency.dylib`merged partial apply forwarder for closure #1 (Swift.UnsafeContinuation<τ_0_0, Swift.Never>) -> () in Swift.withCheckedContinuation<τ_0_0>(function: Swift.String, _: (Swift.CheckedContinuation<τ_0_0, Swift.Never>) -> ()) async -> τ_0_0 + 28
    frame #14: 0x00000002589fb49c libswift_Concurrency.dylib`Swift.withUnsafeThrowingContinuation<τ_0_0>((Swift.UnsafeContinuation<τ_0_0, Swift.Error>) -> ()) async throws -> τ_0_0 + 128
    frame #15: 0x00000002589fb244 libswift_Concurrency.dylib`(1) await resume partial function for Swift.withCheckedThrowingContinuation<τ_0_0>(function: Swift.String, _: (Swift.CheckedContinuation<τ_0_0, Swift.Error>) -> ()) async throws -> τ_0_0
    frame #16: 0x00000001001d1dec ConnectionPoolCrash`closure #1 in ConnectionPool<>.leaseConnection(requestID=20, self=0x0000600002c94000) at ConnectionRequest.swift:55
    frame #17: 0x00000001001d200c ConnectionPoolCrash`partial apply for closure #1 in ConnectionPool<>.leaseConnection() at <compiler-generated>:0
    frame #18: 0x0000000258a137f0 libswift_Concurrency.dylib`(1) await resume partial function for Swift.withTaskCancellationHandler<τ_0_0>(operation: () async throws -> τ_0_0, onCancel: @Sendable () -> ()) async throws -> τ_0_0
    frame #19: 0x00000001001bbbd0 ConnectionPoolCrash`withTaskCancellationHandler<T>(operation:onCancel:) at <compiler-generated>:0
    frame #20: 0x00000001001d19b4 ConnectionPoolCrash`ConnectionPool<>.leaseConnection(self=0x0000600002c94000) at ConnectionRequest.swift:50
    frame #21: 0x0000000100124630 ConnectionPoolCrash`PostgresClient.leaseConnection(self=0x00006000037905a0) at PostgresClient.swift:433
    frame #22: 0x0000000100123fb0 ConnectionPoolCrash`PostgresClient.withConnection<Result>(closure=0x100fcb2c8, self=0x00006000037905a0) at PostgresClient.swift:300
    frame #23: 0x0000000100009388 ConnectionPoolCrash`closure #1 in closure #1 in runOnce #1 (client=0x00006000037905a0, logger=Logging.Logger @ 0x00006000037909d8, idleTimeout=60) in pgsql() at pgsql.swift:55
    frame #24: 0x000000010000a898 ConnectionPoolCrash`partial apply for closure #1 in closure #1 in runOnce #1 () in pgsql() at <compiler-generated>:0
  thread #34, queue = 'nio.transportservices.eventloop.taskqueue'
    frame #0: 0x0000000192318ea4 libsystem_kernel.dylib`__psynch_mutexwait + 8
    frame #1: 0x00000001025bbe10 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 100
    frame #2: 0x00000001025bbd2c libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 248
    frame #3: 0x00000001921fc73c libsystem_c.dylib`flockfile + 40
    frame #4: 0x0000000100263148 ConnectionPoolCrash`closure #1 in StdioOutputStream.write(utf8Bytes=142 values (0x12920a6b0), self=Logging.StdioOutputStream @ 0x0000000170487dd0) at Logging.swift:1202:13
    frame #5: 0x0000000100268abc ConnectionPoolCrash`partial apply for closure #1 in StdioOutputStream.write(_:) at <compiler-generated>:0
    frame #6: 0x00000001a22374b0 libswiftCore.dylib`Swift.String.UTF8View.withContiguousStorageIfAvailable<τ_0_0>((Swift.UnsafeBufferPointer<Swift.UInt8>) throws -> τ_0_0) throws -> Swift.Optional<τ_0_0> + 108
    frame #7: 0x0000000100262f98 ConnectionPoolCrash`StdioOutputStream.write(string="2024-05-07T19:47:34+0200 debug connection-pool-crash : psql_connection_id=14 psql_error=ioOnClosedChannel [PostgresNIO] Channel error caught.\n", self=Logging.StdioOutputStream @ 0x0000000170487ee0) at Logging.swift:1196:37
    frame #8: 0x0000000100263760 ConnectionPoolCrash`protocol witness for TextOutputStream.write(_:) in conformance StdioOutputStream at <compiler-generated>:0
    frame #9: 0x00000001002649bc ConnectionPoolCrash`StreamLogHandler.log(level=debug, message=(value = "Channel error caught."), explicitMetadata=1 key/value pair, source="PostgresNIO", file="PostgresNIO/PostgresChannelHandler.swift", function="errorCaught(context:error:)", line=104, self=Logging.StreamLogHandler @ 0x0000600003d90c90) at Logging.swift:1352:16
    frame #10: 0x0000000100266150 ConnectionPoolCrash`protocol witness for LogHandler.log(level:message:metadata:source:file:function:line:) in conformance StreamLogHandler at <compiler-generated>:0
    frame #11: 0x000000010025bb8c ConnectionPoolCrash`Logger.log(level=debug, message=0x00000001000b2dd4 ConnectionPoolCrash`partial apply forwarder for implicit closure #1 () -> Logging.Logger.Message in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, metadata=0x00000001000b2e24 ConnectionPoolCrash`partial apply forwarder for implicit closure #2 () -> Swift.Optional<Swift.Dictionary<Swift.String, Logging.Logger.MetadataValue>> in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, source=0x00000001000b2e50 ConnectionPoolCrash`partial apply forwarder for implicit closure #3 () -> Swift.Optional<Swift.String> in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, file="PostgresNIO/PostgresChannelHandler.swift", function="errorCaught(context:error:)", line=104, self=Logging.Logger @ 0x00000001704886b0) at Logging.swift:87:26
    frame #12: 0x00000001000b2da4 ConnectionPoolCrash`Logger.debug(message=0x00000001000f0980 ConnectionPoolCrash`implicit closure #1 () -> Logging.Logger.Message in PostgresNIO.PostgresChannelHandler.errorCaught(context: NIOCore.ChannelHandlerContext, error: Swift.Error) -> () at <compiler-generated>, metadata=0x00000001000f0b08 ConnectionPoolCrash`partial apply forwarder for implicit closure #2 () -> PostgresNIO.PSQLLoggingMetadata in PostgresNIO.PostgresChannelHandler.errorCaught(context: NIOCore.ChannelHandlerContext, error: Swift.Error) -> () at <compiler-generated>, source=0x00000001000f0b10 ConnectionPoolCrash`implicit closure #3 () -> Swift.Optional<Swift.String> in PostgresNIO.PostgresChannelHandler.errorCaught(context: NIOCore.ChannelHandlerContext, error: Swift.Error) -> () at <compiler-generated>, file="PostgresNIO/PostgresChannelHandler.swift", function="errorCaught(context:error:)", line=104, self=Logging.Logger @ 0x00000001704886b0) at Logging+PSQL.swift:99:14
    frame #13: 0x00000001000f08e8 ConnectionPoolCrash`PostgresChannelHandler.errorCaught(context=0x0000600003798600, error=ioOnClosedChannel, self=0x0000000127607be0) at PostgresChannelHandler.swift:104:21
    frame #14: 0x00000001000f8b3c ConnectionPoolCrash`protocol witness for _ChannelInboundHandler.errorCaught(context:error:) in conformance PostgresChannelHandler at <compiler-generated>:0
    frame #15: 0x000000010039409c ConnectionPoolCrash`ChannelHandlerContext.invokeErrorCaught(error=ioOnClosedChannel, self=0x0000600003798600) at ChannelPipeline.swift:1765:28
    frame #16: 0x0000000100390b94 ConnectionPoolCrash`ChannelPipeline.fireErrorCaught0(error=ioOnClosedChannel, self=0x0000600003088c30) at ChannelPipeline.swift:944:29
    frame #17: 0x00000001003908d4 ConnectionPoolCrash`ChannelPipeline.fireErrorCaught(error=ioOnClosedChannel, self=0x0000600003088c30) at ChannelPipeline.swift:717:13
    frame #18: 0x000000010057e1b0 ConnectionPoolCrash`StateManagedNWConnectionChannel.doClose0(error=ioOnClosedChannel, self=0x0000600002c9c2d0) at StateManagedNWConnectionChannel.swift:279:27
    frame #19: 0x00000001005511d8 ConnectionPoolCrash`protocol witness for StateManagedChannel.doClose0(error:) in conformance NIOTSConnectionChannel at <compiler-generated>:0
    frame #20: 0x000000010056da00 ConnectionPoolCrash`StateManagedChannel.close0(error=ioOnClosedChannel, mode=all, promise=nil, self=0x0000600002c9c2d0) at StateManagedChannel.swift:206:18
    frame #21: 0x0000000100551500 ConnectionPoolCrash`protocol witness for ChannelCore.close0(error:mode:promise:) in conformance NIOTSConnectionChannel at <compiler-generated>:0
    frame #22: 0x0000000100397018 ConnectionPoolCrash`HeadChannelHandler.close(context=0x000060000379ca80, mode=all, promise=nil, self=0x0000600001190260) at ChannelPipeline.swift:1366:38
    frame #23: 0x00000001003972fc ConnectionPoolCrash`protocol witness for _ChannelOutboundHandler.close(context:mode:promise:) in conformance HeadChannelHandler at <compiler-generated>:0
    frame #24: 0x0000000100392584 ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x000060000379ca80) at ChannelPipeline.swift:1856:29
    frame #25: 0x0000000100399040 ConnectionPoolCrash`ChannelHandlerContext.close(mode=all, promise=nil, self=0x0000600003798600) at ChannelPipeline.swift:1672:26
    frame #26: 0x00000001000f45dc ConnectionPoolCrash`PostgresChannelHandler.closeConnectionAndCleanup(cleanup=PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext @ 0x00000001704891c0, context=0x0000600003798600, self=0x0000000127607be0) at PostgresChannelHandler.swift:587:21
    frame #27: 0x00000001000ef6e4 ConnectionPoolCrash`PostgresChannelHandler.run(action=closeConnectionAndCleanup, context=0x0000600003798600, self=0x0000000127607be0) at PostgresChannelHandler.swift:345:18
    frame #28: 0x00000001000f2b3c ConnectionPoolCrash`PostgresChannelHandler.close(context=0x0000600003798600, mode=all, promise=nil, self=0x0000000127607be0) at PostgresChannelHandler.swift:273:14
    frame #29: 0x00000001000f8bec ConnectionPoolCrash`protocol witness for _ChannelOutboundHandler.close(context:mode:promise:) in conformance PostgresChannelHandler at <compiler-generated>:0
    frame #30: 0x0000000100392584 ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x0000600003798600) at ChannelPipeline.swift:1856:29
    frame #31: 0x00000001003925ec ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x0000600003798840) at ChannelPipeline.swift:1858:24
    frame #32: 0x0000000100390dc4 ConnectionPoolCrash`ChannelPipeline.close0(mode=all, promise=nil, self=0x0000600003088c30) at ChannelPipeline.swift:827:30
    frame #33: 0x0000000100390eb4 ConnectionPoolCrash`closure #1 in ChannelPipeline.close(self=0x0000600003088c30, mode=all, promise=nil) at ChannelPipeline.swift:730:22
    frame #34: 0x0000000100556914 ConnectionPoolCrash`thunk for @escaping @callee_guaranteed @Sendable () -> () at <compiler-generated>:0
    frame #35: 0x000000010271eb0c libdispatch.dylib`_dispatch_block_async_invoke2 + 148
    frame #36: 0x000000010270aba4 libdispatch.dylib`_dispatch_client_callout + 20
    frame #37: 0x0000000102713d88 libdispatch.dylib`_dispatch_lane_serial_drain + 864
    frame #38: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #39: 0x0000000102713b98 libdispatch.dylib`_dispatch_lane_serial_drain + 368
    frame #40: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #41: 0x0000000102724958 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 652
    frame #42: 0x0000000102723c30 libdispatch.dylib`_dispatch_workloop_worker_thread + 444
    frame #43: 0x00000001025b7d40 libsystem_pthread.dylib`_pthread_wqthread + 288
  thread #35, queue = 'nio.transportservices.eventloop.taskqueue'
    frame #0: 0x0000000192318ea4 libsystem_kernel.dylib`__psynch_mutexwait + 8
    frame #1: 0x00000001025bbe10 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 100
    frame #2: 0x00000001025bbd2c libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 248
    frame #3: 0x00000001921fc73c libsystem_c.dylib`flockfile + 40
    frame #4: 0x0000000100263148 ConnectionPoolCrash`closure #1 in StdioOutputStream.write(utf8Bytes=141 values (0x129106e80), self=Logging.StdioOutputStream @ 0x0000000170513dd0) at Logging.swift:1202:13
    frame #5: 0x0000000100268abc ConnectionPoolCrash`partial apply for closure #1 in StdioOutputStream.write(_:) at <compiler-generated>:0
    frame #6: 0x00000001a22374b0 libswiftCore.dylib`Swift.String.UTF8View.withContiguousStorageIfAvailable<τ_0_0>((Swift.UnsafeBufferPointer<Swift.UInt8>) throws -> τ_0_0) throws -> Swift.Optional<τ_0_0> + 108
    frame #7: 0x0000000100262f98 ConnectionPoolCrash`StdioOutputStream.write(string="2024-05-07T19:47:34+0200 debug connection-pool-crash : psql_connection_id=9 psql_error=ioOnClosedChannel [PostgresNIO] Channel error caught.\n", self=Logging.StdioOutputStream @ 0x0000000170513ee0) at Logging.swift:1196:37
    frame #8: 0x0000000100263760 ConnectionPoolCrash`protocol witness for TextOutputStream.write(_:) in conformance StdioOutputStream at <compiler-generated>:0
    frame #9: 0x00000001002649bc ConnectionPoolCrash`StreamLogHandler.log(level=debug, message=(value = "Channel error caught."), explicitMetadata=1 key/value pair, source="PostgresNIO", file="PostgresNIO/PostgresChannelHandler.swift", function="errorCaught(context:error:)", line=104, self=Logging.StreamLogHandler @ 0x0000600003d80290) at Logging.swift:1352:16
    frame #10: 0x0000000100266150 ConnectionPoolCrash`protocol witness for LogHandler.log(level:message:metadata:source:file:function:line:) in conformance StreamLogHandler at <compiler-generated>:0
    frame #11: 0x000000010025bb8c ConnectionPoolCrash`Logger.log(level=debug, message=0x00000001000b2dd4 ConnectionPoolCrash`partial apply forwarder for implicit closure #1 () -> Logging.Logger.Message in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, metadata=0x00000001000b2e24 ConnectionPoolCrash`partial apply forwarder for implicit closure #2 () -> Swift.Optional<Swift.Dictionary<Swift.String, Logging.Logger.MetadataValue>> in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, source=0x00000001000b2e50 ConnectionPoolCrash`partial apply forwarder for implicit closure #3 () -> Swift.Optional<Swift.String> in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, file="PostgresNIO/PostgresChannelHandler.swift", function="errorCaught(context:error:)", line=104, self=Logging.Logger @ 0x00000001705146b0) at Logging.swift:87:26
    frame #12: 0x00000001000b2da4 ConnectionPoolCrash`Logger.debug(message=0x00000001000f0980 ConnectionPoolCrash`implicit closure #1 () -> Logging.Logger.Message in PostgresNIO.PostgresChannelHandler.errorCaught(context: NIOCore.ChannelHandlerContext, error: Swift.Error) -> () at <compiler-generated>, metadata=0x00000001000f0b08 ConnectionPoolCrash`partial apply forwarder for implicit closure #2 () -> PostgresNIO.PSQLLoggingMetadata in PostgresNIO.PostgresChannelHandler.errorCaught(context: NIOCore.ChannelHandlerContext, error: Swift.Error) -> () at <compiler-generated>, source=0x00000001000f0b10 ConnectionPoolCrash`implicit closure #3 () -> Swift.Optional<Swift.String> in PostgresNIO.PostgresChannelHandler.errorCaught(context: NIOCore.ChannelHandlerContext, error: Swift.Error) -> () at <compiler-generated>, file="PostgresNIO/PostgresChannelHandler.swift", function="errorCaught(context:error:)", line=104, self=Logging.Logger @ 0x00000001705146b0) at Logging+PSQL.swift:99:14
    frame #13: 0x00000001000f08e8 ConnectionPoolCrash`PostgresChannelHandler.errorCaught(context=0x0000600003791560, error=ioOnClosedChannel, self=0x000000012900c840) at PostgresChannelHandler.swift:104:21
    frame #14: 0x00000001000f8b3c ConnectionPoolCrash`protocol witness for _ChannelInboundHandler.errorCaught(context:error:) in conformance PostgresChannelHandler at <compiler-generated>:0
    frame #15: 0x000000010039409c ConnectionPoolCrash`ChannelHandlerContext.invokeErrorCaught(error=ioOnClosedChannel, self=0x0000600003791560) at ChannelPipeline.swift:1765:28
    frame #16: 0x0000000100390b94 ConnectionPoolCrash`ChannelPipeline.fireErrorCaught0(error=ioOnClosedChannel, self=0x00006000030b05a0) at ChannelPipeline.swift:944:29
    frame #17: 0x00000001003908d4 ConnectionPoolCrash`ChannelPipeline.fireErrorCaught(error=ioOnClosedChannel, self=0x00006000030b05a0) at ChannelPipeline.swift:717:13
    frame #18: 0x000000010057e1b0 ConnectionPoolCrash`StateManagedNWConnectionChannel.doClose0(error=ioOnClosedChannel, self=0x0000600002c802d0) at StateManagedNWConnectionChannel.swift:279:27
    frame #19: 0x00000001005511d8 ConnectionPoolCrash`protocol witness for StateManagedChannel.doClose0(error:) in conformance NIOTSConnectionChannel at <compiler-generated>:0
    frame #20: 0x000000010056da00 ConnectionPoolCrash`StateManagedChannel.close0(error=ioOnClosedChannel, mode=all, promise=nil, self=0x0000600002c802d0) at StateManagedChannel.swift:206:18
    frame #21: 0x0000000100551500 ConnectionPoolCrash`protocol witness for ChannelCore.close0(error:mode:promise:) in conformance NIOTSConnectionChannel at <compiler-generated>:0
    frame #22: 0x0000000100397018 ConnectionPoolCrash`HeadChannelHandler.close(context=0x000060000378c0c0, mode=all, promise=nil, self=0x0000600001190260) at ChannelPipeline.swift:1366:38
    frame #23: 0x00000001003972fc ConnectionPoolCrash`protocol witness for _ChannelOutboundHandler.close(context:mode:promise:) in conformance HeadChannelHandler at <compiler-generated>:0
    frame #24: 0x0000000100392584 ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x000060000378c0c0) at ChannelPipeline.swift:1856:29
    frame #25: 0x0000000100399040 ConnectionPoolCrash`ChannelHandlerContext.close(mode=all, promise=nil, self=0x0000600003791560) at ChannelPipeline.swift:1672:26
    frame #26: 0x00000001000f45dc ConnectionPoolCrash`PostgresChannelHandler.closeConnectionAndCleanup(cleanup=PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext @ 0x00000001705151c0, context=0x0000600003791560, self=0x000000012900c840) at PostgresChannelHandler.swift:587:21
    frame #27: 0x00000001000ef6e4 ConnectionPoolCrash`PostgresChannelHandler.run(action=closeConnectionAndCleanup, context=0x0000600003791560, self=0x000000012900c840) at PostgresChannelHandler.swift:345:18
    frame #28: 0x00000001000f2b3c ConnectionPoolCrash`PostgresChannelHandler.close(context=0x0000600003791560, mode=all, promise=nil, self=0x000000012900c840) at PostgresChannelHandler.swift:273:14
    frame #29: 0x00000001000f8bec ConnectionPoolCrash`protocol witness for _ChannelOutboundHandler.close(context:mode:promise:) in conformance PostgresChannelHandler at <compiler-generated>:0
    frame #30: 0x0000000100392584 ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x0000600003791560) at ChannelPipeline.swift:1856:29
    frame #31: 0x00000001003925ec ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x00006000037914a0) at ChannelPipeline.swift:1858:24
    frame #32: 0x0000000100390dc4 ConnectionPoolCrash`ChannelPipeline.close0(mode=all, promise=nil, self=0x00006000030b05a0) at ChannelPipeline.swift:827:30
    frame #33: 0x0000000100390eb4 ConnectionPoolCrash`closure #1 in ChannelPipeline.close(self=0x00006000030b05a0, mode=all, promise=nil) at ChannelPipeline.swift:730:22
    frame #34: 0x0000000100556914 ConnectionPoolCrash`thunk for @escaping @callee_guaranteed @Sendable () -> () at <compiler-generated>:0
    frame #35: 0x000000010271eb0c libdispatch.dylib`_dispatch_block_async_invoke2 + 148
    frame #36: 0x000000010270aba4 libdispatch.dylib`_dispatch_client_callout + 20
    frame #37: 0x0000000102713d88 libdispatch.dylib`_dispatch_lane_serial_drain + 864
    frame #38: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #39: 0x0000000102713b98 libdispatch.dylib`_dispatch_lane_serial_drain + 368
    frame #40: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #41: 0x0000000102724958 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 652
    frame #42: 0x0000000102723c30 libdispatch.dylib`_dispatch_workloop_worker_thread + 444
    frame #43: 0x00000001025b7d40 libsystem_pthread.dylib`_pthread_wqthread + 288
  thread #36, queue = 'nio.transportservices.eventloop.taskqueue'
    frame #0: 0x0000000192318ea4 libsystem_kernel.dylib`__psynch_mutexwait + 8
    frame #1: 0x00000001025bbe10 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 100
    frame #2: 0x00000001025bbd2c libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 248
    frame #3: 0x00000001921fc73c libsystem_c.dylib`flockfile + 40
    frame #4: 0x0000000100263148 ConnectionPoolCrash`closure #1 in StdioOutputStream.write(utf8Bytes=142 values (0x102005a50), self=Logging.StdioOutputStream @ 0x000000017059fdd0) at Logging.swift:1202:13
    frame #5: 0x0000000100268abc ConnectionPoolCrash`partial apply for closure #1 in StdioOutputStream.write(_:) at <compiler-generated>:0
    frame #6: 0x00000001a22374b0 libswiftCore.dylib`Swift.String.UTF8View.withContiguousStorageIfAvailable<τ_0_0>((Swift.UnsafeBufferPointer<Swift.UInt8>) throws -> τ_0_0) throws -> Swift.Optional<τ_0_0> + 108
    frame #7: 0x0000000100262f98 ConnectionPoolCrash`StdioOutputStream.write(string="2024-05-07T19:47:34+0200 debug connection-pool-crash : psql_connection_id=13 psql_error=ioOnClosedChannel [PostgresNIO] Channel error caught.\n", self=Logging.StdioOutputStream @ 0x000000017059fee0) at Logging.swift:1196:37
    frame #8: 0x0000000100263760 ConnectionPoolCrash`protocol witness for TextOutputStream.write(_:) in conformance StdioOutputStream at <compiler-generated>:0
    frame #9: 0x00000001002649bc ConnectionPoolCrash`StreamLogHandler.log(level=debug, message=(value = "Channel error caught."), explicitMetadata=1 key/value pair, source="PostgresNIO", file="PostgresNIO/PostgresChannelHandler.swift", function="errorCaught(context:error:)", line=104, self=Logging.StreamLogHandler @ 0x0000600003d8c110) at Logging.swift:1352:16
    frame #10: 0x0000000100266150 ConnectionPoolCrash`protocol witness for LogHandler.log(level:message:metadata:source:file:function:line:) in conformance StreamLogHandler at <compiler-generated>:0
    frame #11: 0x000000010025bb8c ConnectionPoolCrash`Logger.log(level=debug, message=0x00000001000b2dd4 ConnectionPoolCrash`partial apply forwarder for implicit closure #1 () -> Logging.Logger.Message in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, metadata=0x00000001000b2e24 ConnectionPoolCrash`partial apply forwarder for implicit closure #2 () -> Swift.Optional<Swift.Dictionary<Swift.String, Logging.Logger.MetadataValue>> in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, source=0x00000001000b2e50 ConnectionPoolCrash`partial apply forwarder for implicit closure #3 () -> Swift.Optional<Swift.String> in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, file="PostgresNIO/PostgresChannelHandler.swift", function="errorCaught(context:error:)", line=104, self=Logging.Logger @ 0x00000001705a06b0) at Logging.swift:87:26
    frame #12: 0x00000001000b2da4 ConnectionPoolCrash`Logger.debug(message=0x00000001000f0980 ConnectionPoolCrash`implicit closure #1 () -> Logging.Logger.Message in PostgresNIO.PostgresChannelHandler.errorCaught(context: NIOCore.ChannelHandlerContext, error: Swift.Error) -> () at <compiler-generated>, metadata=0x00000001000f0b08 ConnectionPoolCrash`partial apply forwarder for implicit closure #2 () -> PostgresNIO.PSQLLoggingMetadata in PostgresNIO.PostgresChannelHandler.errorCaught(context: NIOCore.ChannelHandlerContext, error: Swift.Error) -> () at <compiler-generated>, source=0x00000001000f0b10 ConnectionPoolCrash`implicit closure #3 () -> Swift.Optional<Swift.String> in PostgresNIO.PostgresChannelHandler.errorCaught(context: NIOCore.ChannelHandlerContext, error: Swift.Error) -> () at <compiler-generated>, file="PostgresNIO/PostgresChannelHandler.swift", function="errorCaught(context:error:)", line=104, self=Logging.Logger @ 0x00000001705a06b0) at Logging+PSQL.swift:99:14
    frame #13: 0x00000001000f08e8 ConnectionPoolCrash`PostgresChannelHandler.errorCaught(context=0x0000600003781a40, error=ioOnClosedChannel, self=0x0000000107607790) at PostgresChannelHandler.swift:104:21
    frame #14: 0x00000001000f8b3c ConnectionPoolCrash`protocol witness for _ChannelInboundHandler.errorCaught(context:error:) in conformance PostgresChannelHandler at <compiler-generated>:0
    frame #15: 0x000000010039409c ConnectionPoolCrash`ChannelHandlerContext.invokeErrorCaught(error=ioOnClosedChannel, self=0x0000600003781a40) at ChannelPipeline.swift:1765:28
    frame #16: 0x0000000100390b94 ConnectionPoolCrash`ChannelPipeline.fireErrorCaught0(error=ioOnClosedChannel, self=0x0000600003099bd0) at ChannelPipeline.swift:944:29
    frame #17: 0x00000001003908d4 ConnectionPoolCrash`ChannelPipeline.fireErrorCaught(error=ioOnClosedChannel, self=0x0000600003099bd0) at ChannelPipeline.swift:717:13
    frame #18: 0x000000010057e1b0 ConnectionPoolCrash`StateManagedNWConnectionChannel.doClose0(error=ioOnClosedChannel, self=0x0000600002c942d0) at StateManagedNWConnectionChannel.swift:279:27
    frame #19: 0x00000001005511d8 ConnectionPoolCrash`protocol witness for StateManagedChannel.doClose0(error:) in conformance NIOTSConnectionChannel at <compiler-generated>:0
    frame #20: 0x000000010056da00 ConnectionPoolCrash`StateManagedChannel.close0(error=ioOnClosedChannel, mode=all, promise=nil, self=0x0000600002c942d0) at StateManagedChannel.swift:206:18
    frame #21: 0x0000000100551500 ConnectionPoolCrash`protocol witness for ChannelCore.close0(error:mode:promise:) in conformance NIOTSConnectionChannel at <compiler-generated>:0
    frame #22: 0x0000000100397018 ConnectionPoolCrash`HeadChannelHandler.close(context=0x0000600003788000, mode=all, promise=nil, self=0x0000600001190260) at ChannelPipeline.swift:1366:38
    frame #23: 0x00000001003972fc ConnectionPoolCrash`protocol witness for _ChannelOutboundHandler.close(context:mode:promise:) in conformance HeadChannelHandler at <compiler-generated>:0
    frame #24: 0x0000000100392584 ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x0000600003788000) at ChannelPipeline.swift:1856:29
    frame #25: 0x0000000100399040 ConnectionPoolCrash`ChannelHandlerContext.close(mode=all, promise=nil, self=0x0000600003781a40) at ChannelPipeline.swift:1672:26
    frame #26: 0x00000001000f45dc ConnectionPoolCrash`PostgresChannelHandler.closeConnectionAndCleanup(cleanup=PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext @ 0x00000001705a11c0, context=0x0000600003781a40, self=0x0000000107607790) at PostgresChannelHandler.swift:587:21
    frame #27: 0x00000001000ef6e4 ConnectionPoolCrash`PostgresChannelHandler.run(action=closeConnectionAndCleanup, context=0x0000600003781a40, self=0x0000000107607790) at PostgresChannelHandler.swift:345:18
    frame #28: 0x00000001000f2b3c ConnectionPoolCrash`PostgresChannelHandler.close(context=0x0000600003781a40, mode=all, promise=nil, self=0x0000000107607790) at PostgresChannelHandler.swift:273:14
    frame #29: 0x00000001000f8bec ConnectionPoolCrash`protocol witness for _ChannelOutboundHandler.close(context:mode:promise:) in conformance PostgresChannelHandler at <compiler-generated>:0
    frame #30: 0x0000000100392584 ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x0000600003781a40) at ChannelPipeline.swift:1856:29
    frame #31: 0x00000001003925ec ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x00006000037819e0) at ChannelPipeline.swift:1858:24
    frame #32: 0x0000000100390dc4 ConnectionPoolCrash`ChannelPipeline.close0(mode=all, promise=nil, self=0x0000600003099bd0) at ChannelPipeline.swift:827:30
    frame #33: 0x0000000100390eb4 ConnectionPoolCrash`closure #1 in ChannelPipeline.close(self=0x0000600003099bd0, mode=all, promise=nil) at ChannelPipeline.swift:730:22
    frame #34: 0x0000000100556914 ConnectionPoolCrash`thunk for @escaping @callee_guaranteed @Sendable () -> () at <compiler-generated>:0
    frame #35: 0x000000010271eb0c libdispatch.dylib`_dispatch_block_async_invoke2 + 148
    frame #36: 0x000000010270aba4 libdispatch.dylib`_dispatch_client_callout + 20
    frame #37: 0x0000000102713d88 libdispatch.dylib`_dispatch_lane_serial_drain + 864
    frame #38: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #39: 0x0000000102713b98 libdispatch.dylib`_dispatch_lane_serial_drain + 368
    frame #40: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #41: 0x0000000102724958 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 652
    frame #42: 0x0000000102723c30 libdispatch.dylib`_dispatch_workloop_worker_thread + 444
    frame #43: 0x00000001025b7d40 libsystem_pthread.dylib`_pthread_wqthread + 288
  thread #37, queue = 'nio.transportservices.eventloop.taskqueue'
    frame #0: 0x0000000192318ea4 libsystem_kernel.dylib`__psynch_mutexwait + 8
    frame #1: 0x00000001025bbe10 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 100
    frame #2: 0x00000001025bbd2c libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 248
    frame #3: 0x00000001921fc73c libsystem_c.dylib`flockfile + 40
    frame #4: 0x0000000100263148 ConnectionPoolCrash`closure #1 in StdioOutputStream.write(utf8Bytes=142 values (0x12910bd70), self=Logging.StdioOutputStream @ 0x000000017062bdd0) at Logging.swift:1202:13
    frame #5: 0x0000000100268abc ConnectionPoolCrash`partial apply for closure #1 in StdioOutputStream.write(_:) at <compiler-generated>:0
    frame #6: 0x00000001a22374b0 libswiftCore.dylib`Swift.String.UTF8View.withContiguousStorageIfAvailable<τ_0_0>((Swift.UnsafeBufferPointer<Swift.UInt8>) throws -> τ_0_0) throws -> Swift.Optional<τ_0_0> + 108
    frame #7: 0x0000000100262f98 ConnectionPoolCrash`StdioOutputStream.write(string="2024-05-07T19:47:34+0200 debug connection-pool-crash : psql_connection_id=11 psql_error=ioOnClosedChannel [PostgresNIO] Channel error caught.\n", self=Logging.StdioOutputStream @ 0x000000017062bee0) at Logging.swift:1196:37
    frame #8: 0x0000000100263760 ConnectionPoolCrash`protocol witness for TextOutputStream.write(_:) in conformance StdioOutputStream at <compiler-generated>:0
    frame #9: 0x00000001002649bc ConnectionPoolCrash`StreamLogHandler.log(level=debug, message=(value = "Channel error caught."), explicitMetadata=1 key/value pair, source="PostgresNIO", file="PostgresNIO/PostgresChannelHandler.swift", function="errorCaught(context:error:)", line=104, self=Logging.StreamLogHandler @ 0x0000600003d88090) at Logging.swift:1352:16
    frame #10: 0x0000000100266150 ConnectionPoolCrash`protocol witness for LogHandler.log(level:message:metadata:source:file:function:line:) in conformance StreamLogHandler at <compiler-generated>:0
    frame #11: 0x000000010025bb8c ConnectionPoolCrash`Logger.log(level=debug, message=0x00000001000b2dd4 ConnectionPoolCrash`partial apply forwarder for implicit closure #1 () -> Logging.Logger.Message in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, metadata=0x00000001000b2e24 ConnectionPoolCrash`partial apply forwarder for implicit closure #2 () -> Swift.Optional<Swift.Dictionary<Swift.String, Logging.Logger.MetadataValue>> in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, source=0x00000001000b2e50 ConnectionPoolCrash`partial apply forwarder for implicit closure #3 () -> Swift.Optional<Swift.String> in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, file="PostgresNIO/PostgresChannelHandler.swift", function="errorCaught(context:error:)", line=104, self=Logging.Logger @ 0x000000017062c6b0) at Logging.swift:87:26
    frame #12: 0x00000001000b2da4 ConnectionPoolCrash`Logger.debug(message=0x00000001000f0980 ConnectionPoolCrash`implicit closure #1 () -> Logging.Logger.Message in PostgresNIO.PostgresChannelHandler.errorCaught(context: NIOCore.ChannelHandlerContext, error: Swift.Error) -> () at <compiler-generated>, metadata=0x00000001000f0b08 ConnectionPoolCrash`partial apply forwarder for implicit closure #2 () -> PostgresNIO.PSQLLoggingMetadata in PostgresNIO.PostgresChannelHandler.errorCaught(context: NIOCore.ChannelHandlerContext, error: Swift.Error) -> () at <compiler-generated>, source=0x00000001000f0b10 ConnectionPoolCrash`implicit closure #3 () -> Swift.Optional<Swift.String> in PostgresNIO.PostgresChannelHandler.errorCaught(context: NIOCore.ChannelHandlerContext, error: Swift.Error) -> () at <compiler-generated>, file="PostgresNIO/PostgresChannelHandler.swift", function="errorCaught(context:error:)", line=104, self=Logging.Logger @ 0x000000017062c6b0) at Logging+PSQL.swift:99:14
    frame #13: 0x00000001000f08e8 ConnectionPoolCrash`PostgresChannelHandler.errorCaught(context=0x0000600003782100, error=ioOnClosedChannel, self=0x0000000107607920) at PostgresChannelHandler.swift:104:21
    frame #14: 0x00000001000f8b3c ConnectionPoolCrash`protocol witness for _ChannelInboundHandler.errorCaught(context:error:) in conformance PostgresChannelHandler at <compiler-generated>:0
    frame #15: 0x000000010039409c ConnectionPoolCrash`ChannelHandlerContext.invokeErrorCaught(error=ioOnClosedChannel, self=0x0000600003782100) at ChannelPipeline.swift:1765:28
    frame #16: 0x0000000100390b94 ConnectionPoolCrash`ChannelPipeline.fireErrorCaught0(error=ioOnClosedChannel, self=0x00006000030b04b0) at ChannelPipeline.swift:944:29
    frame #17: 0x00000001003908d4 ConnectionPoolCrash`ChannelPipeline.fireErrorCaught(error=ioOnClosedChannel, self=0x00006000030b04b0) at ChannelPipeline.swift:717:13
    frame #18: 0x000000010057e1b0 ConnectionPoolCrash`StateManagedNWConnectionChannel.doClose0(error=ioOnClosedChannel, self=0x0000600002c8c2d0) at StateManagedNWConnectionChannel.swift:279:27
    frame #19: 0x00000001005511d8 ConnectionPoolCrash`protocol witness for StateManagedChannel.doClose0(error:) in conformance NIOTSConnectionChannel at <compiler-generated>:0
    frame #20: 0x000000010056da00 ConnectionPoolCrash`StateManagedChannel.close0(error=ioOnClosedChannel, mode=all, promise=nil, self=0x0000600002c8c2d0) at StateManagedChannel.swift:206:18
    frame #21: 0x0000000100551500 ConnectionPoolCrash`protocol witness for ChannelCore.close0(error:mode:promise:) in conformance NIOTSConnectionChannel at <compiler-generated>:0
    frame #22: 0x0000000100397018 ConnectionPoolCrash`HeadChannelHandler.close(context=0x0000600003781560, mode=all, promise=nil, self=0x0000600001190260) at ChannelPipeline.swift:1366:38
    frame #23: 0x00000001003972fc ConnectionPoolCrash`protocol witness for _ChannelOutboundHandler.close(context:mode:promise:) in conformance HeadChannelHandler at <compiler-generated>:0
    frame #24: 0x0000000100392584 ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x0000600003781560) at ChannelPipeline.swift:1856:29
    frame #25: 0x0000000100399040 ConnectionPoolCrash`ChannelHandlerContext.close(mode=all, promise=nil, self=0x0000600003782100) at ChannelPipeline.swift:1672:26
    frame #26: 0x00000001000f45dc ConnectionPoolCrash`PostgresChannelHandler.closeConnectionAndCleanup(cleanup=PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext @ 0x000000017062d1c0, context=0x0000600003782100, self=0x0000000107607920) at PostgresChannelHandler.swift:587:21
    frame #27: 0x00000001000ef6e4 ConnectionPoolCrash`PostgresChannelHandler.run(action=closeConnectionAndCleanup, context=0x0000600003782100, self=0x0000000107607920) at PostgresChannelHandler.swift:345:18
    frame #28: 0x00000001000f2b3c ConnectionPoolCrash`PostgresChannelHandler.close(context=0x0000600003782100, mode=all, promise=nil, self=0x0000000107607920) at PostgresChannelHandler.swift:273:14
    frame #29: 0x00000001000f8bec ConnectionPoolCrash`protocol witness for _ChannelOutboundHandler.close(context:mode:promise:) in conformance PostgresChannelHandler at <compiler-generated>:0
    frame #30: 0x0000000100392584 ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x0000600003782100) at ChannelPipeline.swift:1856:29
    frame #31: 0x00000001003925ec ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x0000600003782160) at ChannelPipeline.swift:1858:24
    frame #32: 0x0000000100390dc4 ConnectionPoolCrash`ChannelPipeline.close0(mode=all, promise=nil, self=0x00006000030b04b0) at ChannelPipeline.swift:827:30
    frame #33: 0x0000000100390eb4 ConnectionPoolCrash`closure #1 in ChannelPipeline.close(self=0x00006000030b04b0, mode=all, promise=nil) at ChannelPipeline.swift:730:22
    frame #34: 0x0000000100556914 ConnectionPoolCrash`thunk for @escaping @callee_guaranteed @Sendable () -> () at <compiler-generated>:0
    frame #35: 0x000000010271eb0c libdispatch.dylib`_dispatch_block_async_invoke2 + 148
    frame #36: 0x000000010270aba4 libdispatch.dylib`_dispatch_client_callout + 20
    frame #37: 0x0000000102713d88 libdispatch.dylib`_dispatch_lane_serial_drain + 864
    frame #38: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #39: 0x0000000102713b98 libdispatch.dylib`_dispatch_lane_serial_drain + 368
    frame #40: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #41: 0x0000000102724958 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 652
    frame #42: 0x0000000102723c30 libdispatch.dylib`_dispatch_workloop_worker_thread + 444
    frame #43: 0x00000001025b7d40 libsystem_pthread.dylib`_pthread_wqthread + 288
  thread #38, queue = 'nio.transportservices.eventloop.taskqueue'
    frame #0: 0x0000000192318ea4 libsystem_kernel.dylib`__psynch_mutexwait + 8
    frame #1: 0x00000001025bbe10 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 100
    frame #2: 0x00000001025bbd2c libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 248
    frame #3: 0x00000001001d8a18 ConnectionPoolCrash`static LockOperations.lock(mutex=0x600002f9c0c0, self=_ConnectionPoolModule.LockOperations) at NIOLock.swift:80:19
    frame #4: 0x00000001001d95c0 ConnectionPoolCrash`closure #1 in LockStorage.withLockedValue<τ_0_0>(valuePtr=0x600002f9c010, lockPtr=0x600002f9c0c0, mutate=0x1001bcf78) at NIOLock.swift:174:28
    frame #5: 0x00000001001d9bfc ConnectionPoolCrash`partial apply for closure #1 in LockStorage.withLockedValue<τ_0_0>(_:) at <compiler-generated>:0
    frame #6: 0x00000001a21815a8 libswiftCore.dylib`Swift.ManagedBuffer.withUnsafeMutablePointers<τ_0_0>((Swift.UnsafeMutablePointer<τ_0_0>, Swift.UnsafeMutablePointer<τ_0_1>) throws -> τ_1_0) throws -> τ_1_0 + 180
    frame #7: 0x00000001001d9524 ConnectionPoolCrash`LockStorage.withLockedValue<τ_0_0>(mutate=0x1001bcf78, self=0x0000600002f9c000) at NIOLock.swift:173:18
    frame #8: 0x00000001001da348 ConnectionPoolCrash`NIOLockedValueBox.withLockedValue<τ_0_0>(mutate=0x1001bcf78, self=_ConnectionPoolModule.NIOLockedValueBox<_ConnectionPoolModule.ConnectionPool<PostgresNIO.PostgresConnection, Swift.Int, _ConnectionPoolModule.ConnectionIDGenerator, _ConnectionPoolModule.ConnectionRequest<PostgresNIO.PostgresConnection>, Swift.Int, PostgresNIO.PostgresKeepAliveBehavor, PostgresNIO.PostgresClientMetrics, Swift.ContinuousClock>.State> @ 0x00000001706b9948) at NIOLockedValueBox.swift:42:34
    frame #9: 0x00000001001b5838 ConnectionPoolCrash`ConnectionPool.modifyStateAndRunActions(closure=0x1001c2890, self=0x0000600002c94000) at ConnectionPool.swift:355:37
    frame #10: 0x00000001001bbf78 ConnectionPoolCrash`ConnectionPool.connectionDidClose(connection=0x0000600003880cb0, error=nil, self=0x0000600002c94000) at ConnectionPool.swift:301:14
    frame #11: 0x00000001001c3b40 ConnectionPoolCrash`closure #1 in closure #1 in closure #1 in ConnectionPool.makeConnection<Connection>($0=nil, self=0x0000600002c94000, bundle=_ConnectionPoolModule.ConnectionAndMetadata<PostgresNIO.PostgresConnection> @ 0x00000001706ba098, continuation=(canary = 0x0000600001dc1950)) at ConnectionPool.swift:434:30
    frame #12: 0x00000001001292dc ConnectionPoolCrash`closure #1 in PostgresConnection.onClose(_0=(success = () @ 0x00000001706ba140), closure=0x00000001001ce62c ConnectionPoolCrash`partial apply forwarder for closure #1 @Sendable (Swift.Optional<Swift.Error>) -> () in closure #1 (Swift.CheckedContinuation<(), Swift.Never>) -> () in closure #1 @Sendable () async -> () in _ConnectionPoolModule.ConnectionPool.makeConnection<A where A1: _ConnectionPoolModule.TaskGroupProtocol>(for: _ConnectionPoolModule.PoolStateMachine<A, C, B, D, E, Swift.CheckedContinuation<(), Swift.Never>>.ConnectionRequest, in: inout A1) -> () at <compiler-generated>) at PostgresClient.swift:482:46
    frame #13: 0x00000001003d54c0 ConnectionPoolCrash`closure #1 in EventLoopFuture._publicWhenComplete(callback=0x100129670, self=0x0000600003099d60) at EventLoopFuture.swift:839:13
    frame #14: 0x00000001003ce440 ConnectionPoolCrash`CallbackList._run(self=NIOCore.CallbackList @ 0x00000001706ba4e8) at EventLoopFuture.swift:89:27
    frame #15: 0x00000001003cee5c ConnectionPoolCrash`EventLoopPromise._resolve(value=(success = () @ 0x00000001706ba600, failure = Swift.Error @ 0x00000001706ba600), self=NIOCore.EventLoopPromise<()> @ 0x00000001706ba5c8) at EventLoopFuture.swift:238:42
    frame #16: 0x00000001003ced28 ConnectionPoolCrash`EventLoopPromise.succeed(value=() @ 0xffffffffffffffff, self=NIOCore.EventLoopPromise<()> @ 0x00000001706ba648) at EventLoopFuture.swift:183:14
    frame #17: 0x000000010056df88 ConnectionPoolCrash`closure #1 in StateManagedChannel.close0(self=0x0000600002c941e0) at StateManagedChannel.swift:229:35
    frame #18: 0x0000000100556914 ConnectionPoolCrash`thunk for @escaping @callee_guaranteed @Sendable () -> () at <compiler-generated>:0
    frame #19: 0x000000010271eb0c libdispatch.dylib`_dispatch_block_async_invoke2 + 148
    frame #20: 0x000000010270aba4 libdispatch.dylib`_dispatch_client_callout + 20
    frame #21: 0x0000000102713d88 libdispatch.dylib`_dispatch_lane_serial_drain + 864
    frame #22: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #23: 0x0000000102713b98 libdispatch.dylib`_dispatch_lane_serial_drain + 368
    frame #24: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #25: 0x0000000102724958 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 652
    frame #26: 0x0000000102723c30 libdispatch.dylib`_dispatch_workloop_worker_thread + 444
    frame #27: 0x00000001025b7d40 libsystem_pthread.dylib`_pthread_wqthread + 288
  thread #39, queue = 'com.apple.network.connection-4'
    frame #0: 0x00000001920a81e8 libsystem_trace.dylib`os_trace_blob_addns + 200
    frame #1: 0x00000001920a7e18 libsystem_trace.dylib`_os_log_fmt_flatten_data_into_blob + 108
    frame #2: 0x00000001920a7d50 libsystem_trace.dylib`_os_log_fmt_flatten_to_blob + 244
    frame #3: 0x00000001920a6460 libsystem_trace.dylib`_os_log_impl_flatten_and_send + 2076
    frame #4: 0x00000001920a5c2c libsystem_trace.dylib`_os_log + 168
    frame #5: 0x00000001920a5b7c libsystem_trace.dylib`_os_log_impl + 28
    frame #6: 0x00000001998ec668 Network`nw_endpoint_handler_cancel + 916
    frame #7: 0x0000000199dcfe1c Network`-[NWConcrete_nw_endpoint_flow cancelWithHandler:forced:] + 836
    frame #8: 0x00000001998ec930 Network`nw_endpoint_handler_cancel + 1628
    frame #9: 0x0000000199846a94 Network`__nw_connection_cancel_inner_block_invoke + 1456
    frame #10: 0x0000000102708f2c libdispatch.dylib`_dispatch_call_block_and_release + 32
    frame #11: 0x000000010270aba4 libdispatch.dylib`_dispatch_client_callout + 20
    frame #12: 0x0000000102713d88 libdispatch.dylib`_dispatch_lane_serial_drain + 864
    frame #13: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #14: 0x00000001027169c4 libdispatch.dylib`_dispatch_workloop_invoke + 2888
    frame #15: 0x0000000102724958 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 652
    frame #16: 0x0000000102723c30 libdispatch.dylib`_dispatch_workloop_worker_thread + 444
    frame #17: 0x00000001025b7d40 libsystem_pthread.dylib`_pthread_wqthread + 288
  thread #40, queue = 'nio.transportservices.eventloop.taskqueue'
    frame #0: 0x0000000192318ea4 libsystem_kernel.dylib`__psynch_mutexwait + 8
    frame #1: 0x00000001025bbe10 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 100
    frame #2: 0x00000001025bbd2c libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 248
    frame #3: 0x00000001921fc73c libsystem_c.dylib`flockfile + 40
    frame #4: 0x0000000100263148 ConnectionPoolCrash`closure #1 in StdioOutputStream.write(utf8Bytes=276 values (0x127609560), self=Logging.StdioOutputStream @ 0x00000001707d07c0) at Logging.swift:1202:13
    frame #5: 0x0000000100268abc ConnectionPoolCrash`partial apply for closure #1 in StdioOutputStream.write(_:) at <compiler-generated>:0
    frame #6: 0x00000001a22374b0 libswiftCore.dylib`Swift.String.UTF8View.withContiguousStorageIfAvailable<τ_0_0>((Swift.UnsafeBufferPointer<Swift.UInt8>) throws -> τ_0_0) throws -> Swift.Optional<τ_0_0> + 108
    frame #7: 0x0000000100262f98 ConnectionPoolCrash`StdioOutputStream.write(string="2024-05-07T19:47:34+0200 debug connection-pool-crash : psql_connection_id=0 psql_error=PSQLError – Generic description to prevent accidental leakage of sensitive data. For debugging details, use `String(reflecting: error)`. [PostgresNIO] Cleaning up and closing connection.\n", self=Logging.StdioOutputStream @ 0x00000001707d08d0) at Logging.swift:1196:37
    frame #8: 0x0000000100263760 ConnectionPoolCrash`protocol witness for TextOutputStream.write(_:) in conformance StdioOutputStream at <compiler-generated>:0
    frame #9: 0x00000001002649bc ConnectionPoolCrash`StreamLogHandler.log(level=debug, message=(value = "Cleaning up and closing connection."), explicitMetadata=1 key/value pair, source="PostgresNIO", file="PostgresNIO/PostgresChannelHandler.swift", function="closeConnectionAndCleanup(_:context:)", line=567, self=Logging.StreamLogHandler @ 0x0000600003d8c090) at Logging.swift:1352:16
    frame #10: 0x0000000100266150 ConnectionPoolCrash`protocol witness for LogHandler.log(level:message:metadata:source:file:function:line:) in conformance StreamLogHandler at <compiler-generated>:0
    frame #11: 0x000000010025bb8c ConnectionPoolCrash`Logger.log(level=debug, message=0x00000001000b2dd4 ConnectionPoolCrash`partial apply forwarder for implicit closure #1 () -> Logging.Logger.Message in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, metadata=0x00000001000b2e24 ConnectionPoolCrash`partial apply forwarder for implicit closure #2 () -> Swift.Optional<Swift.Dictionary<Swift.String, Logging.Logger.MetadataValue>> in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, source=0x00000001000b2e50 ConnectionPoolCrash`partial apply forwarder for implicit closure #3 () -> Swift.Optional<Swift.String> in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, file="PostgresNIO/PostgresChannelHandler.swift", function="closeConnectionAndCleanup(_:context:)", line=567, self=Logging.Logger @ 0x00000001707d1178) at Logging.swift:87:26
    frame #12: 0x00000001000b2da4 ConnectionPoolCrash`Logger.debug(message=0x00000001000f757c ConnectionPoolCrash`implicit closure #1 () -> Logging.Logger.Message in PostgresNIO.PostgresChannelHandler.closeConnectionAndCleanup(_: PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext, context: NIOCore.ChannelHandlerContext) -> () at <compiler-generated>, metadata=0x00000001000fa4e8 ConnectionPoolCrash`partial apply forwarder for implicit closure #2 () -> PostgresNIO.PSQLLoggingMetadata in PostgresNIO.PostgresChannelHandler.closeConnectionAndCleanup(_: PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext, context: NIOCore.ChannelHandlerContext) -> () at <compiler-generated>, source=0x00000001000f7728 ConnectionPoolCrash`implicit closure #3 () -> Swift.Optional<Swift.String> in PostgresNIO.PostgresChannelHandler.closeConnectionAndCleanup(_: PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext, context: NIOCore.ChannelHandlerContext) -> () at <compiler-generated>, file="PostgresNIO/PostgresChannelHandler.swift", function="closeConnectionAndCleanup(_:context:)", line=567, self=Logging.Logger @ 0x00000001707d1178) at Logging+PSQL.swift:99:14
    frame #13: 0x00000001000f42c4 ConnectionPoolCrash`PostgresChannelHandler.closeConnectionAndCleanup(cleanup=PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext @ 0x00000001707d11c0, context=0x0000600003791200, self=0x000000012900b1c0) at PostgresChannelHandler.swift:567:21
    frame #14: 0x00000001000ef6e4 ConnectionPoolCrash`PostgresChannelHandler.run(action=closeConnectionAndCleanup, context=0x0000600003791200, self=0x000000012900b1c0) at PostgresChannelHandler.swift:345:18
    frame #15: 0x00000001000f2b3c ConnectionPoolCrash`PostgresChannelHandler.close(context=0x0000600003791200, mode=all, promise=nil, self=0x000000012900b1c0) at PostgresChannelHandler.swift:273:14
    frame #16: 0x00000001000f8bec ConnectionPoolCrash`protocol witness for _ChannelOutboundHandler.close(context:mode:promise:) in conformance PostgresChannelHandler at <compiler-generated>:0
    frame #17: 0x0000000100392584 ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x0000600003791200) at ChannelPipeline.swift:1856:29
    frame #18: 0x00000001003925ec ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x0000600003791320) at ChannelPipeline.swift:1858:24
    frame #19: 0x0000000100390dc4 ConnectionPoolCrash`ChannelPipeline.close0(mode=all, promise=nil, self=0x000060000309e3a0) at ChannelPipeline.swift:827:30
    frame #20: 0x0000000100390eb4 ConnectionPoolCrash`closure #1 in ChannelPipeline.close(self=0x000060000309e3a0, mode=all, promise=nil) at ChannelPipeline.swift:730:22
    frame #21: 0x0000000100556914 ConnectionPoolCrash`thunk for @escaping @callee_guaranteed @Sendable () -> () at <compiler-generated>:0
    frame #22: 0x000000010271eb0c libdispatch.dylib`_dispatch_block_async_invoke2 + 148
    frame #23: 0x000000010270aba4 libdispatch.dylib`_dispatch_client_callout + 20
    frame #24: 0x0000000102713d88 libdispatch.dylib`_dispatch_lane_serial_drain + 864
    frame #25: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #26: 0x0000000102713b98 libdispatch.dylib`_dispatch_lane_serial_drain + 368
    frame #27: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #28: 0x0000000102724958 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 652
    frame #29: 0x0000000102723c30 libdispatch.dylib`_dispatch_workloop_worker_thread + 444
    frame #30: 0x00000001025b7d40 libsystem_pthread.dylib`_pthread_wqthread + 288
  thread #41, queue = 'nio.transportservices.eventloop.taskqueue'
    frame #0: 0x0000000192318ea4 libsystem_kernel.dylib`__psynch_mutexwait + 8
    frame #1: 0x00000001025bbe10 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 100
    frame #2: 0x00000001025bbd2c libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 248
    frame #3: 0x00000001921fc73c libsystem_c.dylib`flockfile + 40
    frame #4: 0x0000000100263148 ConnectionPoolCrash`closure #1 in StdioOutputStream.write(utf8Bytes=276 values (0x12910e2f0), self=Logging.StdioOutputStream @ 0x000000017085c7c0) at Logging.swift:1202:13
    frame #5: 0x0000000100268abc ConnectionPoolCrash`partial apply for closure #1 in StdioOutputStream.write(_:) at <compiler-generated>:0
    frame #6: 0x00000001a22374b0 libswiftCore.dylib`Swift.String.UTF8View.withContiguousStorageIfAvailable<τ_0_0>((Swift.UnsafeBufferPointer<Swift.UInt8>) throws -> τ_0_0) throws -> Swift.Optional<τ_0_0> + 108
    frame #7: 0x0000000100262f98 ConnectionPoolCrash`StdioOutputStream.write(string="2024-05-07T19:47:34+0200 debug connection-pool-crash : psql_connection_id=2 psql_error=PSQLError – Generic description to prevent accidental leakage of sensitive data. For debugging details, use `String(reflecting: error)`. [PostgresNIO] Cleaning up and closing connection.\n", self=Logging.StdioOutputStream @ 0x000000017085c8d0) at Logging.swift:1196:37
    frame #8: 0x0000000100263760 ConnectionPoolCrash`protocol witness for TextOutputStream.write(_:) in conformance StdioOutputStream at <compiler-generated>:0
    frame #9: 0x00000001002649bc ConnectionPoolCrash`StreamLogHandler.log(level=debug, message=(value = "Cleaning up and closing connection."), explicitMetadata=1 key/value pair, source="PostgresNIO", file="PostgresNIO/PostgresChannelHandler.swift", function="closeConnectionAndCleanup(_:context:)", line=567, self=Logging.StreamLogHandler @ 0x0000600003d9c910) at Logging.swift:1352:16
    frame #10: 0x0000000100266150 ConnectionPoolCrash`protocol witness for LogHandler.log(level:message:metadata:source:file:function:line:) in conformance StreamLogHandler at <compiler-generated>:0
    frame #11: 0x000000010025bb8c ConnectionPoolCrash`Logger.log(level=debug, message=0x00000001000b2dd4 ConnectionPoolCrash`partial apply forwarder for implicit closure #1 () -> Logging.Logger.Message in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, metadata=0x00000001000b2e24 ConnectionPoolCrash`partial apply forwarder for implicit closure #2 () -> Swift.Optional<Swift.Dictionary<Swift.String, Logging.Logger.MetadataValue>> in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, source=0x00000001000b2e50 ConnectionPoolCrash`partial apply forwarder for implicit closure #3 () -> Swift.Optional<Swift.String> in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, file="PostgresNIO/PostgresChannelHandler.swift", function="closeConnectionAndCleanup(_:context:)", line=567, self=Logging.Logger @ 0x000000017085d178) at Logging.swift:87:26
    frame #12: 0x00000001000b2da4 ConnectionPoolCrash`Logger.debug(message=0x00000001000f757c ConnectionPoolCrash`implicit closure #1 () -> Logging.Logger.Message in PostgresNIO.PostgresChannelHandler.closeConnectionAndCleanup(_: PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext, context: NIOCore.ChannelHandlerContext) -> () at <compiler-generated>, metadata=0x00000001000fa4e8 ConnectionPoolCrash`partial apply forwarder for implicit closure #2 () -> PostgresNIO.PSQLLoggingMetadata in PostgresNIO.PostgresChannelHandler.closeConnectionAndCleanup(_: PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext, context: NIOCore.ChannelHandlerContext) -> () at <compiler-generated>, source=0x00000001000f7728 ConnectionPoolCrash`implicit closure #3 () -> Swift.Optional<Swift.String> in PostgresNIO.PostgresChannelHandler.closeConnectionAndCleanup(_: PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext, context: NIOCore.ChannelHandlerContext) -> () at <compiler-generated>, file="PostgresNIO/PostgresChannelHandler.swift", function="closeConnectionAndCleanup(_:context:)", line=567, self=Logging.Logger @ 0x000000017085d178) at Logging+PSQL.swift:99:14
    frame #13: 0x00000001000f42c4 ConnectionPoolCrash`PostgresChannelHandler.closeConnectionAndCleanup(cleanup=PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext @ 0x000000017085d1c0, context=0x00006000037960a0, self=0x0000000127707150) at PostgresChannelHandler.swift:567:21
    frame #14: 0x00000001000ef6e4 ConnectionPoolCrash`PostgresChannelHandler.run(action=closeConnectionAndCleanup, context=0x00006000037960a0, self=0x0000000127707150) at PostgresChannelHandler.swift:345:18
    frame #15: 0x00000001000f2b3c ConnectionPoolCrash`PostgresChannelHandler.close(context=0x00006000037960a0, mode=all, promise=nil, self=0x0000000127707150) at PostgresChannelHandler.swift:273:14
    frame #16: 0x00000001000f8bec ConnectionPoolCrash`protocol witness for _ChannelOutboundHandler.close(context:mode:promise:) in conformance PostgresChannelHandler at <compiler-generated>:0
    frame #17: 0x0000000100392584 ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x00006000037960a0) at ChannelPipeline.swift:1856:29
    frame #18: 0x00000001003925ec ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x0000600003796040) at ChannelPipeline.swift:1858:24
    frame #19: 0x0000000100390dc4 ConnectionPoolCrash`ChannelPipeline.close0(mode=all, promise=nil, self=0x00006000030bc280) at ChannelPipeline.swift:827:30
    frame #20: 0x0000000100390eb4 ConnectionPoolCrash`closure #1 in ChannelPipeline.close(self=0x00006000030bc280, mode=all, promise=nil) at ChannelPipeline.swift:730:22
    frame #21: 0x0000000100556914 ConnectionPoolCrash`thunk for @escaping @callee_guaranteed @Sendable () -> () at <compiler-generated>:0
    frame #22: 0x000000010271eb0c libdispatch.dylib`_dispatch_block_async_invoke2 + 148
    frame #23: 0x000000010270aba4 libdispatch.dylib`_dispatch_client_callout + 20
    frame #24: 0x0000000102713d88 libdispatch.dylib`_dispatch_lane_serial_drain + 864
    frame #25: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #26: 0x0000000102713b98 libdispatch.dylib`_dispatch_lane_serial_drain + 368
    frame #27: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #28: 0x0000000102724958 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 652
    frame #29: 0x0000000102723c30 libdispatch.dylib`_dispatch_workloop_worker_thread + 444
    frame #30: 0x00000001025b7d40 libsystem_pthread.dylib`_pthread_wqthread + 288
  thread #42, queue = 'nio.transportservices.eventloop.taskqueue'
    frame #0: 0x0000000192318ea4 libsystem_kernel.dylib`__psynch_mutexwait + 8
    frame #1: 0x00000001025bbe10 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 100
    frame #2: 0x00000001025bbd2c libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 248
    frame #3: 0x00000001921fc73c libsystem_c.dylib`flockfile + 40
    frame #4: 0x0000000100263148 ConnectionPoolCrash`closure #1 in StdioOutputStream.write(utf8Bytes=276 values (0x102005df0), self=Logging.StdioOutputStream @ 0x00000001708e87c0) at Logging.swift:1202:13
    frame #5: 0x0000000100268abc ConnectionPoolCrash`partial apply for closure #1 in StdioOutputStream.write(_:) at <compiler-generated>:0
    frame #6: 0x00000001a22374b0 libswiftCore.dylib`Swift.String.UTF8View.withContiguousStorageIfAvailable<τ_0_0>((Swift.UnsafeBufferPointer<Swift.UInt8>) throws -> τ_0_0) throws -> Swift.Optional<τ_0_0> + 108
    frame #7: 0x0000000100262f98 ConnectionPoolCrash`StdioOutputStream.write(string="2024-05-07T19:47:34+0200 debug connection-pool-crash : psql_connection_id=3 psql_error=PSQLError – Generic description to prevent accidental leakage of sensitive data. For debugging details, use `String(reflecting: error)`. [PostgresNIO] Cleaning up and closing connection.\n", self=Logging.StdioOutputStream @ 0x00000001708e88d0) at Logging.swift:1196:37
    frame #8: 0x0000000100263760 ConnectionPoolCrash`protocol witness for TextOutputStream.write(_:) in conformance StdioOutputStream at <compiler-generated>:0
    frame #9: 0x00000001002649bc ConnectionPoolCrash`StreamLogHandler.log(level=debug, message=(value = "Cleaning up and closing connection."), explicitMetadata=1 key/value pair, source="PostgresNIO", file="PostgresNIO/PostgresChannelHandler.swift", function="closeConnectionAndCleanup(_:context:)", line=567, self=Logging.StreamLogHandler @ 0x0000600003d98910) at Logging.swift:1352:16
    frame #10: 0x0000000100266150 ConnectionPoolCrash`protocol witness for LogHandler.log(level:message:metadata:source:file:function:line:) in conformance StreamLogHandler at <compiler-generated>:0
    frame #11: 0x000000010025bb8c ConnectionPoolCrash`Logger.log(level=debug, message=0x00000001000b2dd4 ConnectionPoolCrash`partial apply forwarder for implicit closure #1 () -> Logging.Logger.Message in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, metadata=0x00000001000b2e24 ConnectionPoolCrash`partial apply forwarder for implicit closure #2 () -> Swift.Optional<Swift.Dictionary<Swift.String, Logging.Logger.MetadataValue>> in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, source=0x00000001000b2e50 ConnectionPoolCrash`partial apply forwarder for implicit closure #3 () -> Swift.Optional<Swift.String> in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, file="PostgresNIO/PostgresChannelHandler.swift", function="closeConnectionAndCleanup(_:context:)", line=567, self=Logging.Logger @ 0x00000001708e9178) at Logging.swift:87:26
    frame #12: 0x00000001000b2da4 ConnectionPoolCrash`Logger.debug(message=0x00000001000f757c ConnectionPoolCrash`implicit closure #1 () -> Logging.Logger.Message in PostgresNIO.PostgresChannelHandler.closeConnectionAndCleanup(_: PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext, context: NIOCore.ChannelHandlerContext) -> () at <compiler-generated>, metadata=0x00000001000fa4e8 ConnectionPoolCrash`partial apply forwarder for implicit closure #2 () -> PostgresNIO.PSQLLoggingMetadata in PostgresNIO.PostgresChannelHandler.closeConnectionAndCleanup(_: PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext, context: NIOCore.ChannelHandlerContext) -> () at <compiler-generated>, source=0x00000001000f7728 ConnectionPoolCrash`implicit closure #3 () -> Swift.Optional<Swift.String> in PostgresNIO.PostgresChannelHandler.closeConnectionAndCleanup(_: PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext, context: NIOCore.ChannelHandlerContext) -> () at <compiler-generated>, file="PostgresNIO/PostgresChannelHandler.swift", function="closeConnectionAndCleanup(_:context:)", line=567, self=Logging.Logger @ 0x00000001708e9178) at Logging+PSQL.swift:99:14
    frame #13: 0x00000001000f42c4 ConnectionPoolCrash`PostgresChannelHandler.closeConnectionAndCleanup(cleanup=PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext @ 0x00000001708e91c0, context=0x0000600003784c00, self=0x0000000129209370) at PostgresChannelHandler.swift:567:21
    frame #14: 0x00000001000ef6e4 ConnectionPoolCrash`PostgresChannelHandler.run(action=closeConnectionAndCleanup, context=0x0000600003784c00, self=0x0000000129209370) at PostgresChannelHandler.swift:345:18
    frame #15: 0x00000001000f2b3c ConnectionPoolCrash`PostgresChannelHandler.close(context=0x0000600003784c00, mode=all, promise=nil, self=0x0000000129209370) at PostgresChannelHandler.swift:273:14
    frame #16: 0x00000001000f8bec ConnectionPoolCrash`protocol witness for _ChannelOutboundHandler.close(context:mode:promise:) in conformance PostgresChannelHandler at <compiler-generated>:0
    frame #17: 0x0000000100392584 ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x0000600003784c00) at ChannelPipeline.swift:1856:29
    frame #18: 0x00000001003925ec ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x0000600003784960) at ChannelPipeline.swift:1858:24
    frame #19: 0x0000000100390dc4 ConnectionPoolCrash`ChannelPipeline.close0(mode=all, promise=nil, self=0x00006000030b8000) at ChannelPipeline.swift:827:30
    frame #20: 0x0000000100390eb4 ConnectionPoolCrash`closure #1 in ChannelPipeline.close(self=0x00006000030b8000, mode=all, promise=nil) at ChannelPipeline.swift:730:22
    frame #21: 0x0000000100556914 ConnectionPoolCrash`thunk for @escaping @callee_guaranteed @Sendable () -> () at <compiler-generated>:0
    frame #22: 0x000000010271eb0c libdispatch.dylib`_dispatch_block_async_invoke2 + 148
    frame #23: 0x000000010270aba4 libdispatch.dylib`_dispatch_client_callout + 20
    frame #24: 0x0000000102713d88 libdispatch.dylib`_dispatch_lane_serial_drain + 864
    frame #25: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #26: 0x0000000102713b98 libdispatch.dylib`_dispatch_lane_serial_drain + 368    frame #27: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #28: 0x0000000102724958 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 652
    frame #29: 0x0000000102723c30 libdispatch.dylib`_dispatch_workloop_worker_thread + 444
    frame #30: 0x00000001025b7d40 libsystem_pthread.dylib`_pthread_wqthread + 288
  thread #43, queue = 'nio.transportservices.eventloop.taskqueue'
    frame #0: 0x000000019231a0c4 libsystem_kernel.dylib`__write_nocancel + 8
    frame #1: 0x0000000102369618 libLogRedirect.dylib`LogRedirectWrite + 156
    frame #2: 0x000000019221c704 libsystem_c.dylib`__swrite + 24
    frame #3: 0x00000001921fe6b0 libsystem_c.dylib`_swrite + 108
    frame #4: 0x00000001921f1ed4 libsystem_c.dylib`__sfvwrite + 536
    frame #5: 0x000000019220cdcc libsystem_c.dylib`fwrite + 152
    frame #6: 0x00000001002631e4 ConnectionPoolCrash`closure #1 in StdioOutputStream.write(utf8Bytes=142 values (0x102006140), self=Logging.StdioOutputStream @ 0x0000000170973dd0) at Logging.swift:1213:17
    frame #7: 0x0000000100268abc ConnectionPoolCrash`partial apply for closure #1 in StdioOutputStream.write(_:) at <compiler-generated>:0
    frame #8: 0x00000001a22374b0 libswiftCore.dylib`Swift.String.UTF8View.withContiguousStorageIfAvailable<τ_0_0>((Swift.UnsafeBufferPointer<Swift.UInt8>) throws -> τ_0_0) throws -> Swift.Optional<τ_0_0> + 108
    frame #9: 0x0000000100262f98 ConnectionPoolCrash`StdioOutputStream.write(string="2024-05-07T19:47:34+0200 debug connection-pool-crash : psql_connection_id=10 psql_error=ioOnClosedChannel [PostgresNIO] Channel error caught.\n", self=Logging.StdioOutputStream @ 0x0000000170973ee0) at Logging.swift:1196:37
    frame #10: 0x0000000100263760 ConnectionPoolCrash`protocol witness for TextOutputStream.write(_:) in conformance StdioOutputStream at <compiler-generated>:0
    frame #11: 0x00000001002649bc ConnectionPoolCrash`StreamLogHandler.log(level=debug, message=(value = "Channel error caught."), explicitMetadata=1 key/value pair, source="PostgresNIO", file="PostgresNIO/PostgresChannelHandler.swift", function="errorCaught(context:error:)", line=104, self=Logging.StreamLogHandler @ 0x0000600003d94290) at Logging.swift:1352:16
    frame #12: 0x0000000100266150 ConnectionPoolCrash`protocol witness for LogHandler.log(level:message:metadata:source:file:function:line:) in conformance StreamLogHandler at <compiler-generated>:0
    frame #13: 0x000000010025bb8c ConnectionPoolCrash`Logger.log(level=debug, message=0x00000001000b2dd4 ConnectionPoolCrash`partial apply forwarder for implicit closure #1 () -> Logging.Logger.Message in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, metadata=0x00000001000b2e24 ConnectionPoolCrash`partial apply forwarder for implicit closure #2 () -> Swift.Optional<Swift.Dictionary<Swift.String, Logging.Logger.MetadataValue>> in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, source=0x00000001000b2e50 ConnectionPoolCrash`partial apply forwarder for implicit closure #3 () -> Swift.Optional<Swift.String> in Logging.Logger.debug(_: @autoclosure () -> Logging.Logger.Message, metadata: @autoclosure () -> PostgresNIO.PSQLLoggingMetadata, source: @autoclosure () -> Swift.Optional<Swift.String>, file: Swift.String, function: Swift.String, line: Swift.UInt) -> () at <compiler-generated>, file="PostgresNIO/PostgresChannelHandler.swift", function="errorCaught(context:error:)", line=104, self=Logging.Logger @ 0x00000001709746b0) at Logging.swift:87:26
    frame #14: 0x00000001000b2da4 ConnectionPoolCrash`Logger.debug(message=0x00000001000f0980 ConnectionPoolCrash`implicit closure #1 () -> Logging.Logger.Message in PostgresNIO.PostgresChannelHandler.errorCaught(context: NIOCore.ChannelHandlerContext, error: Swift.Error) -> () at <compiler-generated>, metadata=0x00000001000f0b08 ConnectionPoolCrash`partial apply forwarder for implicit closure #2 () -> PostgresNIO.PSQLLoggingMetadata in PostgresNIO.PostgresChannelHandler.errorCaught(context: NIOCore.ChannelHandlerContext, error: Swift.Error) -> () at <compiler-generated>, source=0x00000001000f0b10 ConnectionPoolCrash`implicit closure #3 () -> Swift.Optional<Swift.String> in PostgresNIO.PostgresChannelHandler.errorCaught(context: NIOCore.ChannelHandlerContext, error: Swift.Error) -> () at <compiler-generated>, file="PostgresNIO/PostgresChannelHandler.swift", function="errorCaught(context:error:)", line=104, self=Logging.Logger @ 0x00000001709746b0) at Logging+PSQL.swift:99:14
    frame #15: 0x00000001000f08e8 ConnectionPoolCrash`PostgresChannelHandler.errorCaught(context=0x0000600003791aa0, error=ioOnClosedChannel, self=0x000000012900ec90) at PostgresChannelHandler.swift:104:21
    frame #16: 0x00000001000f8b3c ConnectionPoolCrash`protocol witness for _ChannelInboundHandler.errorCaught(context:error:) in conformance PostgresChannelHandler at <compiler-generated>:0
    frame #17: 0x000000010039409c ConnectionPoolCrash`ChannelHandlerContext.invokeErrorCaught(error=ioOnClosedChannel, self=0x0000600003791aa0) at ChannelPipeline.swift:1765:28
    frame #18: 0x0000000100390b94 ConnectionPoolCrash`ChannelPipeline.fireErrorCaught0(error=ioOnClosedChannel, self=0x000060000309e940) at ChannelPipeline.swift:944:29
    frame #19: 0x00000001003908d4 ConnectionPoolCrash`ChannelPipeline.fireErrorCaught(error=ioOnClosedChannel, self=0x000060000309e940) at ChannelPipeline.swift:717:13
    frame #20: 0x000000010057e1b0 ConnectionPoolCrash`StateManagedNWConnectionChannel.doClose0(error=ioOnClosedChannel, self=0x0000600002c981e0) at StateManagedNWConnectionChannel.swift:279:27
    frame #21: 0x00000001005511d8 ConnectionPoolCrash`protocol witness for StateManagedChannel.doClose0(error:) in conformance NIOTSConnectionChannel at <compiler-generated>:0
    frame #22: 0x000000010056da00 ConnectionPoolCrash`StateManagedChannel.close0(error=ioOnClosedChannel, mode=all, promise=nil, self=0x0000600002c981e0) at StateManagedChannel.swift:206:18
    frame #23: 0x0000000100551500 ConnectionPoolCrash`protocol witness for ChannelCore.close0(error:mode:promise:) in conformance NIOTSConnectionChannel at <compiler-generated>:0
    frame #24: 0x0000000100397018 ConnectionPoolCrash`HeadChannelHandler.close(context=0x0000600003784840, mode=all, promise=nil, self=0x0000600001190260) at ChannelPipeline.swift:1366:38
    frame #25: 0x00000001003972fc ConnectionPoolCrash`protocol witness for _ChannelOutboundHandler.close(context:mode:promise:) in conformance HeadChannelHandler at <compiler-generated>:0
    frame #26: 0x0000000100392584 ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x0000600003784840) at ChannelPipeline.swift:1856:29
    frame #27: 0x0000000100399040 ConnectionPoolCrash`ChannelHandlerContext.close(mode=all, promise=nil, self=0x0000600003791aa0) at ChannelPipeline.swift:1672:26
    frame #28: 0x00000001000f45dc ConnectionPoolCrash`PostgresChannelHandler.closeConnectionAndCleanup(cleanup=PostgresNIO.ConnectionStateMachine.ConnectionAction.CleanUpContext @ 0x00000001709751c0, context=0x0000600003791aa0, self=0x000000012900ec90) at PostgresChannelHandler.swift:587:21
    frame #29: 0x00000001000ef6e4 ConnectionPoolCrash`PostgresChannelHandler.run(action=closeConnectionAndCleanup, context=0x0000600003791aa0, self=0x000000012900ec90) at PostgresChannelHandler.swift:345:18
    frame #30: 0x00000001000f2b3c ConnectionPoolCrash`PostgresChannelHandler.close(context=0x0000600003791aa0, mode=all, promise=nil, self=0x000000012900ec90) at PostgresChannelHandler.swift:273:14
    frame #31: 0x00000001000f8bec ConnectionPoolCrash`protocol witness for _ChannelOutboundHandler.close(context:mode:promise:) in conformance PostgresChannelHandler at <compiler-generated>:0
    frame #32: 0x0000000100392584 ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x0000600003791aa0) at ChannelPipeline.swift:1856:29
    frame #33: 0x00000001003925ec ConnectionPoolCrash`ChannelHandlerContext.invokeClose(mode=all, promise=nil, self=0x0000600003791a40) at ChannelPipeline.swift:1858:24
    frame #34: 0x0000000100390dc4 ConnectionPoolCrash`ChannelPipeline.close0(mode=all, promise=nil, self=0x000060000309e940) at ChannelPipeline.swift:827:30
    frame #35: 0x0000000100390eb4 ConnectionPoolCrash`closure #1 in ChannelPipeline.close(self=0x000060000309e940, mode=all, promise=nil) at ChannelPipeline.swift:730:22
    frame #36: 0x0000000100556914 ConnectionPoolCrash`thunk for @escaping @callee_guaranteed @Sendable () -> () at <compiler-generated>:0
    frame #37: 0x000000010271eb0c libdispatch.dylib`_dispatch_block_async_invoke2 + 148
    frame #38: 0x000000010270aba4 libdispatch.dylib`_dispatch_client_callout + 20
    frame #39: 0x0000000102713d88 libdispatch.dylib`_dispatch_lane_serial_drain + 864
    frame #40: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #41: 0x0000000102713b98 libdispatch.dylib`_dispatch_lane_serial_drain + 368
    frame #42: 0x0000000102714eb0 libdispatch.dylib`_dispatch_lane_invoke + 468
    frame #43: 0x0000000102724958 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 652
    frame #44: 0x0000000102723c30 libdispatch.dylib`_dispatch_workloop_worker_thread + 444
    frame #45: 0x00000001025b7d40 libsystem_pthread.dylib`_pthread_wqthread + 288

I did actually chat with Fabian a moment ago on Discord and we agreed that I'll create a test case for the crash and continue on from there with his guidance if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants