Skip to content

Fix issues that GroupBy and Sample doesn't call 'unsubscribe' and also NPE when the key is null in GroupBy#1959

Closed
zsxwing wants to merge 8 commits into
ReactiveX:1.xfrom
zsxwing:sample-unsubscribe
Closed

Fix issues that GroupBy and Sample doesn't call 'unsubscribe' and also NPE when the key is null in GroupBy#1959
zsxwing wants to merge 8 commits into
ReactiveX:1.xfrom
zsxwing:sample-unsubscribe

Conversation

@zsxwing

@zsxwing zsxwing commented Dec 12, 2014

Copy link
Copy Markdown
Member

Fix #1958

@zsxwing

zsxwing commented Dec 12, 2014

Copy link
Copy Markdown
Member Author

Find two more bugs:

  • GroupBy may not call unsubscribe
  • NPE if the key is null in GroupBy
    The unit tests demonstrates them.

@zsxwing

zsxwing commented Dec 12, 2014

Copy link
Copy Markdown
Member Author

Fixed them in this PR.

@zsxwing zsxwing changed the title Fix the issue that Sample doesn't call 'unsubscribe' Fix the issue that GroupBy and Sample doesn't call 'unsubscribe' and also NPE when the key is null in GroupBy Dec 12, 2014
@zsxwing zsxwing changed the title Fix the issue that GroupBy and Sample doesn't call 'unsubscribe' and also NPE when the key is null in GroupBy Fix issues that GroupBy and Sample doesn't call 'unsubscribe' and also NPE when the key is null in GroupBy Dec 12, 2014

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There is a self member variable which also points to this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This will unsubscribe the downstream. I suggest instead having child.add(sampler); after L52.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I haven't had a chance to try this code yet, but I want to make sure this doesn't break the backpressure functionality where this operator requests Long.MAX_VALUE up.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This will unsubscribe the downstream. I suggest instead having child.add(sampler); after L52.

Could you elaborate? I think unsubscribe the downstream would be OK for this operator.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I haven't had a chance to try this code yet, but I want to make sure this doesn't break the backpressure functionality where this operator requests Long.MAX_VALUE up.

sample with time does not support backpressure as it uses time to control data flow, right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I feel some redundancy here. Maybe it is worth reviewing the other counters and state indicators.

@zsxwing

zsxwing commented Dec 12, 2014

Copy link
Copy Markdown
Member Author

This PR contains a lot. I will split it to 3 PRs.

@zsxwing zsxwing closed this Dec 12, 2014
@zsxwing

zsxwing commented Dec 12, 2014

Copy link
Copy Markdown
Member Author

Split to #1965 #1966 #1967

@zsxwing zsxwing deleted the sample-unsubscribe branch December 15, 2014 07:00
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.

3 participants