2

I am using the @grpc/grpc-js module and I have setup a sample gRPC server:

When I run a gRPC server in electron, if I send a response after a "timeout", then the response is not going to the client at all. It's not closing the http2 stream properly. The same server works fine when run in node directly but giving this issue when run through electron.

The issue doesn't happen if I send the response directly outside the timeout function.

Sample Minimal Project which demonstrates the issue: https://github.com/nateshmbhat/grpc-with-electron-sample-project

Expected Behavior

When the gRPC server sends the response with or without the timeout, the response should reach the client and the associated streams should close properly.

Actual Behavior

Though the server sends the response, the response is not reaching the client. So, the connection and stream don't close.

I have also filed issues for this here:

https://github.com/electron/electron/issues/26838

https://github.com/grpc/grpc-node/issues/1645

Christos Lytras
  • 36,310
  • 4
  • 80
  • 113
Natesh bhat
  • 12,274
  • 10
  • 84
  • 125
  • I think that the `timeout` only used to set a deadline to open a connection. Read this https://github.com/carlessistare/grpc-promise – I_Al-thamary Dec 29 '20 at 21:38
  • according to `doc` if i understand correctly you are already binding the server in [bindAsync](https://grpc.github.io/grpc/node/grpc.Server.html#bindAsync__anchor) because of it result will be asynchronous so what's the use of `settimeout`. – Chandan Jan 01 '21 at 04:30

0 Answers0