Posts

Showing posts from September, 2022

gRPC Troubleshooting

Here are a few quick & dirty troubleshooting tips after a couple days in the trenches with a gRPC service (C# client, C++ server):  Ensure any code creating a new alarm first cancels the last alarm it added to the queue, if it hasn't been processed.  In my case, I had a server-side observer receiving updates from elsewhere in the server module & writing them to the gRPC stream.  When those updates started coming too quickly, it crashed when adding the alarm to the queue. Look for double disconnects.  I had another bug where the client was getting a cancellation exception from the server on the MoveNext() call, caught it, then proceeded to try to disconnect via Cancel() on the cancellation token.  The client then threw an exception: "Shutdown has already been called". Check to see if your client is setting a deadline, which can cause it to close the connection. Ensure your client code handles a cancellation exception coming from MoveNext(). Test by adding...