You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IUC this error indicates the server is trying to send the response when the context has already been cancelled leading to the error. I think the bug in my code is that in between when I was checking whether the context was done and when I send the response the context was actually cancelled. So I can move the context.Done channel to write before I call stream.Send.
However, it seems like there might always be some small probability that in between calling context.Done and stream.Send the context gets cancelled. This got me wondering whether I'm doing something more fundamental wrong?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a bidirectional streaming server written in GoLang. I'm getting an error
The full stack trace is in jlewi/foyle#319. The code is here.
IUC this error indicates the server is trying to send the response when the context has already been cancelled leading to the error. I think the bug in my code is that in between when I was checking whether the context was done and when I send the response the context was actually cancelled. So I can move the context.Done channel to write before I call stream.Send.
However, it seems like there might always be some small probability that in between calling context.Done and stream.Send the context gets cancelled. This got me wondering whether I'm doing something more fundamental wrong?
Beta Was this translation helpful? Give feedback.
All reactions