You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Switching from libpq to postgres-nio, some of my unit tests failed because connections were still alive on the server after closing them on the client.
The connections only disappeared after closing the application.
This can be seen in pg_stat_activity
Sending a terminate message to the server in close() fixed the problem
public func close() -> EventLoopFuture<Void> {
guard !self.didClose else {
return self.eventLoop.makeSucceededFuture(())
}
let _ = self.requestTerminate(logger: logger)
...
extension PostgresMessage {
public struct Terminate: PostgresMessageType {
public static var identifier: PostgresMessage.Identifier {
return .terminate
}
public var description: String {
return "Terminate"
}
public func serialize(into buffer: inout ByteBuffer) {
}
}
}
Is this a bug?
The text was updated successfully, but these errors were encountered:
@sqlisor yeah this seems like a bug to me. MySQLNIO sends a close message to the server before closing the channel so we should follow suit here if that's also what Postgres wants.
Switching from libpq to postgres-nio, some of my unit tests failed because connections were still alive on the server after closing them on the client.
The connections only disappeared after closing the application.
This can be seen in
pg_stat_activity
Sending a terminate message to the server in close() fixed the problem
Is this a bug?
The text was updated successfully, but these errors were encountered: