dimsuz
08/10/2021, 4:40 PMwire
+ grpc client
. On android client which uses okhttp as transport, blocking calls work 👌 , but our test streaming call "hangs" and then exits using socket timeout. We can see that server receives the request but then breakpoint which we have set in server code inside a generated grpc method doesn't even hit, so it hangs somewhere inside grpc stuff on server (presumably).
Swift client, generated using some Apple library, connects and successfully works with the same streaming call. Any idea on how to debug where to look at would be appreciated.Benoit Quenaudon
08/10/2021, 4:44 PMGrpcStreamingCall
.dimsuz
08/10/2021, 4:54 PMdimsuz
08/10/2021, 4:54 PMBenoit Quenaudon
08/10/2021, 4:57 PMdimsuz
08/10/2021, 4:58 PMBenoit Quenaudon
08/10/2021, 5:00 PMBenoit Quenaudon
08/10/2021, 5:00 PMdimsuz
08/10/2021, 5:04 PMval loggingInterceptor = HttpLoggingInterceptor { message -> Timber.tag("OkHttp"); Timber.d(message) }
loggingInterceptor.level = HTTP_LOG_LEVEL
val httpClient = OkHttpClient.Builder()
.protocols(listOf(Protocol.H2_PRIOR_KNOWLEDGE))
.connectTimeout(HTTP_CONNECT_TIMEOUT, TimeUnit.MILLISECONDS)
.readTimeout(HTTP_CONNECT_TIMEOUT, TimeUnit.MILLISECONDS)
.writeTimeout(HTTP_CONNECT_TIMEOUT, TimeUnit.MILLISECONDS)
.addNetworkInterceptor(loggingInterceptor)
.build()
return GrpcClient.Builder()
.client(httpClient)
.baseUrl(baseUrl = "<http://192.168.100.167:8666>")
.build()
Service itself is build with usual wire's grpcClient.create()
and then I just call the streaming call and wait for messages in the receiveChannel (launched on the GlobalScope + Dispatchers.IO for testing)dimsuz
08/10/2021, 5:04 PMBenoit Quenaudon
08/10/2021, 5:06 PMBenoit Quenaudon
08/10/2021, 5:06 PMdimsuz
08/10/2021, 5:06 PMalpha.6
Oh, ok. will continue poking around than. thanks!Benoit Quenaudon
08/10/2021, 5:08 PMBenoit Quenaudon
08/10/2021, 5:09 PMdimsuz
08/10/2021, 5:12 PMBenoit Quenaudon
08/10/2021, 5:16 PMdimsuz
08/10/2021, 5:18 PMdimsuz
08/10/2021, 5:25 PMOUTBOUND SETTINGS: ack=false settings={MAX_CONCURRENT_STREAMS=2147483647, INITIAL_WINDOW_SIZE=1048576, MAX_HEADER_LIST_SIZE=8192}
OUTBOUND WINDOW_UPDATE: streamId=0 windowSizeIncrement=983041
INBOUND SETTINGS: ack=false settings={INITIAL_WINDOW_SIZE=16777216}
OUTBOUND SETTINGS: ack=true
INBOUND WINDOW_UPDATE: streamId=0 windowSizeIncrement=16711681
INBOUND SETTINGS: ack=true
INBOUND HEADERS: streamId=3 headers=GrpcHttp2RequestHeaders[:path: /backend.portfolio.model.PortfolioService/getPortfolioStream, :authority: 192.168.100.167:8666, :method: POST, :scheme: http, te: trailers, grpc-trace-bin: , grpc-accept-encoding: gzip, grpc-encoding: gzip, content-type: application/grpc, accept-encoding: gzip, user-agent: okhttp/4.9.1] padding=0 endStream=false
and then falls silent and no streaming is done
For iOS connection after similar exchange (with a bit different headers), streaming works.dimsuz
08/10/2021, 5:26 PMBenoit Quenaudon
08/10/2021, 5:27 PMdimsuz
08/10/2021, 5:27 PMjessewilson
08/11/2021, 8:31 AMjessewilson
08/11/2021, 8:32 AMdimsuz
08/11/2021, 11:06 AMdimsuz
08/11/2021, 11:32 AM5.0.0-alpha.2
and the stream still hangs and eventually times out.
@jessewilson is there some github issue I can read on this for possible workarounds?dimsuz
08/11/2021, 11:44 AM[34 ms] requestHeadersStart
[41 ms] requestHeadersEnd
[41 ms] requestBodyStart
Setting up flushing for Thread[queued-work-looper,5,main]
[60043 ms] responseFailed: java.net.SocketTimeoutException: timeout
<-- HTTP FAILED: java.net.SocketTimeoutException: timeout
[60045 ms] connectionReleased
[60046 ms] callFailed: java.net.SocketTimeoutException: timeout
Benoit Quenaudon
08/11/2021, 1:22 PMdimsuz
08/11/2021, 2:03 PMdimsuz
08/11/2021, 5:25 PMusePlainText()
when building a transport channel though. In OkHttp I tried to set ConnectionSpec.CLEARTEXT
too, didn't helpdimsuz
08/11/2021, 5:26 PM