grpc-dotnet-namedpipes
grpc-dotnet-namedpipes copied to clipboard
May need a timeout on client read (appears to be infinite?)
Trying this out and I put together some very bad code that was hard to figure out why things were going wrong.
The main symptom was that a client would wait perpetually for a response after successfully sending a message. The server would never receive a message. No errors, no exceptions. I didn't wait very long, a few minutes.
The underlying cause was bad code binding the server:
var server = new NamedPipeServer("MyPipeName");
MyService.BindService(new MyServiceService());
It should have been:
var server = new NamedPipeServer("MyPipeName");
MyService.BindService(server.ServiceBinder, new MyServiceService());
Everything worked "fine" except this never returns:
var channel = new NamedPipeChannel(".", "Test");
var ServiceClient = new MyService.MyServiceClient(channel);
var response = await ServiceClient.SendMessageAsync(new SomeMessaget() { Name = "bugger" });
No errors or exceptions I could find.
I can consider changing the defaults, but there is a client timeout option: https://github.com/cyanfish/grpc-dotnet-namedpipes/blob/043cead5ba3d0e3fb746160dc7e71729a66d657c/GrpcDotNetNamedPipes/NamedPipeChannelOptions.cs#L40
Thanks!
I think that a default of a few seconds would be more helpful. Maybe even 30 seconds at the outside?
I added a 30s default timeout in 2.0.0.