Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dimitriho
Copy link

@dimitriho dimitriho commented Nov 21, 2024

Also fixes #3502

@dimitriho dimitriho marked this pull request as ready for review November 21, 2024 00:29
@@ -208,7 +208,7 @@ object Topic {
}

def publish: Pipe[F, A, Nothing] = { in =>
(in ++ Stream.exec(close.void))
in.onFinalize(close.void)
Copy link
Member

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

Copy link
Author

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.

Copy link
Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Copy link
Author

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.

@dimitriho dimitriho force-pushed the topic-close branch 2 times, most recently from 59d9068 to a46f858 Compare December 1, 2024 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stream hangs on error with broadcastThrough and readOutputStream
3 participants