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 infinite loop in the histogram reduce logic. #7022

Closed
wants to merge 2 commits into from

Conversation

Projects
None yet
3 participants
@jpountz
Copy link
Contributor

commented Jul 24, 2014

The histogram reduce method can run into an infinite loop if the
Rounding.nextRoundingValue value is buggy, which happened to be the case for
DayTimeZoneRoundingFloor.

DayTimeZoneRoundingFloor is fixed, and the histogram reduce method has been
changed to fail instead of running into an infinite loop in case of a buffy
nextRoundingValue impl.

Close #6965

Aggregations: Fix infinite loop in the histogram reduce logic.
The histogram reduce method can run into an infinite loop if the
Rounding.nextRoundingValue value is buggy, which happened to be the case for
DayTimeZoneRoundingFloor.

DayTimeZoneRoundingFloor is fixed, and the histogram reduce method has been
changed to fail instead of running into an infinite loop in case of a buffy
nextRoundingValue impl.

Close #6965

@jpountz jpountz added the review label Jul 24, 2014

@@ -162,7 +162,7 @@ public long valueForKey(long time) {

@Override
public long nextRoundingValue(long value) {
return unit.field().roundCeiling(value + 1);
return unit.field().getDurationField().add(value, 1);

This comment has been minimized.

Copy link
@s1monw

s1monw Jul 29, 2014

Contributor

does it make sense to assign this unit.field().getDurationField() to a field?

This comment has been minimized.

Copy link
@jpountz

jpountz Jul 29, 2014

Author Contributor

yes, will do

@s1monw

This comment has been minimized.

Copy link
Contributor

commented Jul 29, 2014

I think this LGTM - left a minor comment

@s1monw s1monw removed the review label Jul 29, 2014

@jpountz

This comment has been minimized.

Copy link
Contributor Author

commented Jul 29, 2014

@s1monw I pushed a commit that should address your comment.

@jpountz jpountz added review and removed review labels Jul 29, 2014

@jpountz jpountz closed this Aug 1, 2014

@jpountz jpountz deleted the jpountz:fix/histogram_infinite_loop branch Aug 1, 2014

@clintongormley clintongormley changed the title Aggregations: Fix infinite loop in the histogram reduce logic. Fix infinite loop in the histogram reduce logic. Jun 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.