requests from grpc-js on bidi channel sometimes get multiple-seconds delay before being sent
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 716
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 10
Description
### Problem description
I have a gRPC .NET server and grpc / grpc-js client (in Electron main process) connecting over loopback (with client ssl certificates enabled). Client starts a bidi stream and occasionally receives messages from server or sends requests to it.
I just switched from grpc implementation of the client to grpc-js one, but then I noticed that requests from client to server get occasionally delivered with significant delay (2-10s), which doesn't happen at all when using grpc implementation.
### Reproduction steps
The messages and channel outline is like that:
```
message WindowFormsToExternal {
string window = 1;
string action = 2;
repeated string args = 3;
int32 ExternalSequenceNr = 4;
int32 FormsSequenceNr = 5;
}
message WindowExternalToForms {
string window = 1;
string action = 2;
repeated string args = 3;
int32 ExternalSequenceNr = 4;
int32 FormsSequenceNr = 5;
}
service ElectorGateway {
rpc WindowControl(stream WindowExternalToForms) returns (stream WindowFormsToExternal) }
```
The server and client implementations are within larger app, I can try to create a self-contained repro if this is issue cannot be easily tracked down.
I create the client by using
```
var ssl_creds = grpc.credentials.createSsl(creds.ca_cert, creds.ui_key, creds.ui_cert);
var elector_proto = grpc.loadPackageDefinition(packageDefinition)['pro']['elector']['proto'];
this.grpc_client = new elector_proto.ElectorGateway('127.0.0.1:15745', ssl_creds,
{ 'grpc.ssl_target_name_override': 'ElectorAppGen', 'grpc.default_authority': 'ElectorAppGen'});
```
### Environment
- Windows 10, May 2019 update
- Electron 5.0.1 on the client, .NET 4.6.1 on the server
- grpc-js 0.4.0 on the client (comparing with grpc 1.20.3), gRPC .NET 1.21.0 on the server
### Additional context
Thanks for making grpc-js and grpc seemlessly replacable, thanks to that I can clearly pin the problem to grpc-js, since with single-line change I'm testing both variants that the issue only happens when using grpc-js
Contributor guide
Assessment
This issue has not been assessed yet.