stepancheg / grpc-rust

Rust implementation of gRPC
MIT License
1.37k stars 124 forks source link

Java client hangs after receiving certain amount of data from streaming response #74

Closed matklad closed 7 years ago

matklad commented 7 years ago

Hi! I've written a simple client/server both in Kotlin and Rust (four binaries in total), and all combinations work fine except for Rust server + Kotlin client: the client just hangs after receiving about 70k of data. There must be a bug somewhere, but I don't know if it is withing my code, rust grpc or java grpc :(

Here's the code: https://github.com/matklad/kt-rs-grpc.

There are two rpc requests:

The clients then subscribes for updates and sends 100 events, expecting to receive 100 updates: https://github.com/matklad/kt-rs-grpc/blob/master/rs/client.rs#L14-L24

It works except for the case when the server is in Rust, and the client is in Kotlin. The client then doest not receive all the messages:

λ ./build/install/kt/bin/client
recv 0 size 14336
recv 1 size 28672
recv 2 size 43008
recv 3 size 57344
recv 4 size 71680

If I vary the message size, the clients get different number of updates, but there total encoded size comes about 70 kilobytes.

stepancheg commented 7 years ago

I will look into it.

stepancheg commented 7 years ago

The problem seems to be in that grpc-rust ignores SETTINGS_INITIAL_WINDOW_SIZE.

stepancheg commented 7 years ago

Diff in rs code (because API changed in master): https://gist.github.com/stepancheg/f36b5b6f3088d0a06415ea24fc4e450d

stepancheg commented 7 years ago

Uploaded version 0.1.4.