Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@gkfabs
Copy link
Contributor

@gkfabs gkfabs commented Feb 6, 2025

This PR fix Issue #9555 by

  • Be sure to susbcribe to Hub before sending the elements from the stream to it.

It makes now even more sense to change the signature of the function broadcastDynamic as you mention in previous issue #9474

)(implicit trace: Trace): ZIO[R with Scope, Nothing, Chunk[Dequeue[Take[E, A]]]] =
for {
hub <- Hub.bounded[Take[E, A]](maximumLag)
hub <- ZIO.acquireRelease(Hub.bounded[Take[E, A]](maximumLag))(_.shutdown)
Copy link
Contributor

Choose a reason for hiding this comment

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

From what I can tell, broadcastDynamic doesn't use this method (It uses broadcastedQueuesDynamic below)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's true, but that's part of the test suite which is right before the test suite broadcastDynamic. I imagine we need to close the Hub just like we close it in out test suite.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are totally right, this has nothing to do with the point of the issue. I just removed it.

@gkfabs gkfabs marked this pull request as draft February 7, 2025 01:31
@gkfabs gkfabs marked this pull request as draft February 7, 2025 01:31
@gkfabs gkfabs marked this pull request as ready for review February 7, 2025 03:39
Copy link
Contributor

@kyri-petrou kyri-petrou left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! Can you also please annotate the broadcastDynamic suite with @@ nonFlaky to make sure we don't run into the same issue if anyone else changes the code in the future?

} yield assertTrue(cleaned)
}
) @@ TestAspect.timeout(5.seconds) @@ flaky,
) @@ TestAspect.timeout(5.seconds),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add @@ nonFlaky as well?

Copy link
Contributor

@kyri-petrou kyri-petrou left a comment

Choose a reason for hiding this comment

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

Thanks!

@kyri-petrou kyri-petrou merged commit 7245534 into zio:series/2.x Feb 10, 2025
18 checks passed
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.

2 participants