Skip to content

1.x: Fix zip() - observer array becoming visible too early and causing NPE #3688

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

Merged
merged 1 commit into from
Feb 10, 2016

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Feb 9, 2016

Reported in #3687.

By the way, I see several other small problems with zip: it is implemented as an Operator and even though one can know the number of sources upfront, this indirection hides the fact. In addition, it uses SpMc queue but could just use Spsc because there is only one drain thread at a time.

@akarnokd akarnokd added the Bug label Feb 9, 2016
@akarnokd akarnokd changed the title 1.x: Fix the observer array becoming visible too early and causing NPE 1.x: Fix zip() - observer array becoming visible too early and causing NPE Feb 9, 2016
private static final class Zip<R> extends AtomicLong {
static final class Zip<R> extends AtomicLong {
/** */
private static final long serialVersionUID = 5995274816189928317L;
Copy link
Contributor

Choose a reason for hiding this comment

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

We really need it? Also, javadoc comment above does not make sense

Copy link
Member Author

Choose a reason for hiding this comment

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

Less javac warnings.

@artem-zinnatullin
Copy link
Contributor

Few small things, otherwise lgtm 👍

@akarnokd
Copy link
Member Author

Updated.

@stevegury
Copy link
Member

👍

akarnokd added a commit that referenced this pull request Feb 10, 2016
1.x: Fix zip() - observer array becoming visible too early and causing NPE
@akarnokd akarnokd merged commit 4603dcf into ReactiveX:1.x Feb 10, 2016
@akarnokd akarnokd deleted the ZipStartBarrierFix branch February 10, 2016 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants