Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Sources/GRPC/ConnectionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,11 @@ extension ConnectionManager {
internal func startConnecting() {
self.manager.startConnecting()
}

/// Shutdown the manager now.
internal func shutdownNow() {
self.manager._shutdown(mode: .forceful, promise: self.manager.eventLoop.makePromise())
}
}
}

Expand Down
1 change: 1 addition & 0 deletions Sources/GRPC/ConnectionPool/ConnectionPool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,7 @@ extension ConnectionPool: ConnectionManagerConnectivityDelegate {
assert(hadActiveConnection)
if let removed = self._connections.removeValue(forKey: manager.id) {
removed.manager.sync.http2Delegate = nil
removed.manager.sync.shutdownNow() // Manager may have internal state to tear down.
self.delegate?.connectionClosed(id: .init(removed.manager.id), error: nil)
self.delegate?.connectionRemoved(id: .init(removed.manager.id))
}
Expand Down