Giter VIP home page Giter VIP logo

Comments (6)

sbtourist avatar sbtourist commented on June 16, 2024

I should have said it seems to happen inside AbstractHistogram#add, as I can't make it happen during debug, but I was able to "restrict" the area to some application code that loops over a concurrentskiplistmap tail view and does the AbstractHistogram#add.

from hdrhistogram.

sbtourist avatar sbtourist commented on June 16, 2024

After reviewing the AbstractHistogram#add code it was clear that the AIOOBE could have not come from there, and the source is indeed AbstractHistogramIterator#next, called a few lines after when computing the mean of the aggregated histogram.

So, I was able to pin down the bug back into AbstractHistogram#add, which computes an higher total count in case of concurrently modified "from" histograms: pull request #25 should fix it.

from hdrhistogram.

giltene avatar giltene commented on June 16, 2024

This is integrated into the recently pushed v2.0.1

from hdrhistogram.

pcting avatar pcting commented on June 16, 2024

@giltene thanks! I'm going to upgrade to v2.0.2 to see if that helps

from hdrhistogram.

giltene avatar giltene commented on June 16, 2024

Going back to the original way you use this stuff though, I think you may want to start using IntervalHistogramRecorder instead of doing potentially lossy adds on live atomic histograms. IntervalHistogramRecorder guarantees a stable view of the interval histogram, and avoids exposure to concurrent modifications.

With this feature now available, I'm considering whether throwing a concurrent modification exception is not the better way to go when such a copy creates an inconsistent totalCount. We can use the current (your) logic that establishes the totalCount during the loop to cross-check agains the other totalCount, and throw an exception when they don't match.

What do you think?

from hdrhistogram.

sbtourist avatar sbtourist commented on June 16, 2024

Thanks for the heads up @giltene. I will look into IntervalHistogramRecorder, but I think you should keep the current exception-free behaviour: after all, the atomic histograms are the ones concurrently modified (and they are meant to be so), while the add to target histogram is single threaded, so a ConcurrentModificationException would be imho unexpected.

from hdrhistogram.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.