-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Most of the times GRPC works reliably in our app, however in rare cases I noticed this error "Client has been stopped. Can't make any more RPCs." after which the client becomes unusable.
What might be causing this error? I'm not stopping the client manually and network errors doesn't seem to cause it (I don't have a way to reproduce).
It seems like I should be ready to recreate GRPC client (and all service clients that wraps it) if it stops for whatever reason. What should be my approach to make sure my service clients are always usable? Is it true that if client is stopped try await client.runConnections() should complete? Do I need to recreate TransportServices as well?
Here is my client init code for reference:
final class Service {
static let grpcClient = {
let client = GRPCClient(transport: transport,
interceptors: [authInterceptor, loggingInterceptor])
Task { try! await client.runConnections() } // Runs indefinetly
return client
}()
private static let authInterceptor = AuthInterceptor()
private static let loggingInterceptor = LoggingInterceptor()
private static let transport = try! Transport(target: target, transportSecurity: .tls)
typealias Transport = HTTP2ClientTransport.TransportServices
private static let target: any ResolvableTarget = .dns(host: AppConfig.grpcHost)
}Metadata
Metadata
Assignees
Labels
No labels