-
-
Notifications
You must be signed in to change notification settings - Fork 88
Closed
Labels
bugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested
Description
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?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested