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

Fix nondeterministic behavior in Observable.zip operators #1195

Merged
merged 2 commits into from Jun 4, 2020

Conversation

Avasil
Copy link
Collaborator

@Avasil Avasil commented May 31, 2020

Fixes #1167
Fixes #1164

@Avasil Avasil requested a review from alexandru May 31, 2020
continueP = Promise[Ack]()
oldP.completeWith(lastAck)
Copy link
Collaborator Author

@Avasil Avasil May 31, 2020

Choose a reason for hiding this comment

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

This one is a bit puzzling... The method is called from "synchronized" block but I noticed that onNext was allowing the next element in between completing lastAck and replacing continueP with a new promise

@@ -56,7 +56,9 @@ private[reactive] final class Zip3Observable[A1, A2, A3, +R](
// MUST BE synchronized by `lock`
var continueP = Promise[Ack]()
// MUST BE synchronized by `lock`
var completeWithNext = false
var sourcesCompleted: Int = 0
Copy link
Collaborator Author

@Avasil Avasil May 31, 2020

Choose a reason for hiding this comment

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

Might be faster with N booleans or Byte but I'll just leave an issue about it.
It might not matter so I'd rather not spend time on it right now

@Avasil Avasil merged commit d07ad8b into monix:master Jun 4, 2020
1 check was pending
@Avasil Avasil deleted the bugfix/nondeterministic-zip branch Nov 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant