-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent deadlock when publisher is canceled #3505
base: main
Are you sure you want to change the base?
Conversation
@@ -208,7 +208,7 @@ object Topic { | |||
} | |||
|
|||
def publish: Pipe[F, A, Nothing] = { in => | |||
(in ++ Stream.exec(close.void)) | |||
in.onFinalize(close.void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the same fix in Channel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the change, it should also fix #3485. But as @ValdemarGr pointed out, the exit case might not be correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is an attempt to handle cancelation and error in Channel: e1d7b09. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this commit. Regarding Topic, I don't know how to implement the same behavior without exposing raiseError
and canceled
to Channel.
59d9068
to
a46f858
Compare
a46f858
to
09f86e3
Compare
Also fixes #3502