Closed notcome closed 8 months ago
@notcome Thanks I'll look into this. As a workaround you can disable keep-alives for now:
clientConfiguration.options.keepAliveBehavior = nil
Released in 1.19.1. Please check if the issue is fixed for you now.
Describe the bug
So this is a follow up to my previous issue #435 . I mentioned that I often ran into crash on the following line:
https://github.com/vapor/postgres-nio/blob/c8269926eb3b705b70aff1975860e357760123c8/Sources/ConnectionPoolModule/PoolStateMachine%2BConnectionGroup.swift#L441
So I have decided to to modify the source code a bit, added some log, and observed the following thing:
So I suppose this is just a strange weird data race around keep alive timers. But I have seen no pattern why this might happen, nor can I reliably reproduce this issue. Plus I suppose we will never see it if the ping pong can finish in very short period.
I wonder if there is anything I can do to help you people track this down. I am a bit occupied right now, but I will try to add some log and data race check on a local fork when I get some free time.
Expected behavior No error.
Environment Vapor Framework version: 4.84.6 Vapor Toolbox version: 18.7.4 OS version: macOS 14.0 (23A344)