Skip to content

Fix nondeterministic behavior in Observable.zip operators#1195

Merged
Avasil merged 2 commits into
monix:masterfrom
Avasil:bugfix/nondeterministic-zip
Jun 4, 2020
Merged

Fix nondeterministic behavior in Observable.zip operators#1195
Avasil merged 2 commits into
monix:masterfrom
Avasil:bugfix/nondeterministic-zip

Conversation

@Avasil

@Avasil Avasil commented May 31, 2020

Copy link
Copy Markdown
Collaborator

Fixes #1167
Fixes #1164

@Avasil Avasil requested a review from alexandru May 31, 2020 12:02
continueP.completeWith(lastAck)
val oldP = continueP
continueP = Promise[Ack]()
oldP.completeWith(lastAck)

Copy link
Copy Markdown
Collaborator Author

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

var continueP = Promise[Ack]()
// MUST BE synchronized by `lock`
var completeWithNext = false
var sourcesCompleted: Int = 0

Copy link
Copy Markdown
Collaborator Author

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
@Avasil Avasil deleted the bugfix/nondeterministic-zip branch November 14, 2020 15:49
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