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
I'm forking singleflight to add contexts and generics and noticed an inconsistent behavior. You may or may not consider it a bug.
The package goes out of its way to make panics unrecoverable when using DoChan specifically so that any waiting channels won't be blocked forever. The package also goes out of its way to handle runtime.Goexit when using Do but it does nothing to unblock DoChan channels that are waiting when this happens.
What did you expect to see?
I don't have a strong opinion about what the right thing to do is here. I might suggest closing the channels without sending a result, but it's specifically documented that the channel won't be closed. I'm leaning toward sending the errGoexit error to those channels, but I'm not really happy with that either.
The text was updated successfully, but these errors were encountered:
Go version
go version go1.22.2 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
Example with panic: https://go.dev/play/p/fKxw87DNRY6
Example with runtime.Goexit: https://go.dev/play/p/PJIOUMA4eTc
What did you see happen?
I'm forking singleflight to add contexts and generics and noticed an inconsistent behavior. You may or may not consider it a bug.
The package goes out of its way to make panics unrecoverable when using DoChan specifically so that any waiting channels won't be blocked forever. The package also goes out of its way to handle runtime.Goexit when using Do but it does nothing to unblock DoChan channels that are waiting when this happens.
What did you expect to see?
I don't have a strong opinion about what the right thing to do is here. I might suggest closing the channels without sending a result, but it's specifically documented that the channel won't be closed. I'm leaning toward sending the errGoexit error to those channels, but I'm not really happy with that either.
The text was updated successfully, but these errors were encountered: