-
Notifications
You must be signed in to change notification settings - Fork 434
Description
What are you trying to achieve?
We have a GRPC channel in our iOS app that our load balancer times-out after 2 minutes of inactivity. The following code worked until 1.16.0:
let eventsStream = client.readEvents(readEventsRequest)
do {
for try await grpcEvent in eventsStream {
delegate?.receivedEvent(grpcEvent)
}
} catch {
// Timeout is configured on the load balancer, currently set to 2 min.
NSLog("Disconnected from GRPC Channel: \(error)")
// Restart the eventsStream
}
The channel is relatively inactive so when the load balancer disconnects, we just reestablish the connection. This worked fine from roughly grpc-swift version 1.8.2 through 1.15.0, but as of 1.16.0 when the exception is caught, the code that closes the connection also fails an assertion in the GRPC package target which causes the app to crash.
The assertion failure crash itself doesn't hit our code, it's all in a background thread, but I noticed this change in 1.16.0 which the assertion failure passes-through, which led me to reverting to 1.15.0. Full commit is here: 75b390e but unfortunately I don't have enough time or understanding to dig into the guts of all this. Any help is greatly appreciated.
What have you tried so far?
I've looked through the docs to confirm I'm doing things correctly, and best I can tell I am. Reverting to 1.15.0 solves the problem for now, but I was hoping to figure out if I was doing something wrong or if a regression was introduced in 1.16.0.