grpc-swift: Send multiple grpc requests at the same time, when one of them fails, then other requests all call back "Transport became inactive".
let (host, port) = address.convertAddress()
let useTLS = (port == 443)
let group = MultiThreadedEventLoopGroup(numberOfThreads: 1)
let builder = useTLS ? ClientConnection.usingTLSBackedByNIOSSL(on: group) : ClientConnection.insecure(group: group)
let channel = builder.connect(host: host, port: port)
channel.connectivity.delegate = self
We upgraded from grpc0.x to grpc1.7. When the v0.x sends multiple requests at the same time, it will not affect each other when an error occurs, and the v1.7 will call back all ‘Transport became inactive’ after the error occurs.
Is this normal? I expect multiple requests to not affect each other.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 16
There is no connection delegate for the pool.
When I receive the first response with a status code of 502, the ClientChannel will close the connection in the function: handleError(), and subsequent requests will fail(return with ‘Transport became inactive’) until the reconnection succeeds.
See the file: ClientTransport.swift(line:399).
Do you have trace logs? (You can set
logger.logLevel = .trace
)