{"push_id":901059972,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"0997c146060047d260baf0afbffdde610df57cdf","before":"375c755e39f4990cbe688f8f78ccdebfda341d64","commits":[{"sha":"0997c146060047d260baf0afbffdde610df57cdf","author":{"email":"bceb368e7f2cb351af47298f32034f0587bbe4a6@jsoft.biz","name":"Aurelien Broszniowski"},"message":"Attempt to fix RainfallHistorgramSink\n\nrecording a latency was using the RainfallHistorgramSink facade to record the latencies into a static HistogramHolder, which is defined per thread using a ThreadLocal.\nbecause the thread operations are taken from a ThreadPool, the first time a Thread is recording, and no HistogramHolder exist yet, it is created, then reused by all other operations executed by that Thread, regardless of the result.\n\ne.g.\nhistograms.get(result).record(latency)\nFirst time it calls:\nhh = new HistogramHolder<E>(factory.createHistogram());\nThen every other times, it will reuse that histogram holder\nSo let’s say, that the first time, for \"Thread 1” of the thread pool,  the result = MISS, it will get the RainfallHistogramSink that will create the HistogramHolder\nSecond time, for Thread 1, say the result is MISS again, it will get the same RainfallHistogramSink that already has the HistogramHolder instantiated so it will record correctly.\nThen Third time for Thread 1, say now the result is PUT, it will get another RainfallHistogramSink, and when getting the HistogramHolder from the ThreadLocal, it will get the one holding values for the MISS, so it will record the latency there.\n\nIn the end, the first results to have called a thread will ‘own’ the HistogramHolder and you will get erroneous Histograms because they will be an addition of any result from the operation executed by that Thread.\n\nProposed fix:\nmove the CHM down into the RainfallHistogramSink.\nthe ThreadLocal of the RainfallHistogramSink will have the CHM and record each result independently for every thread\nwhen fetching the results at the end, all actives HistogramHolders (from all threads) are aggregated for a specific Result.","distinct":true,"url":"https://api.github.com/repos/aurbroszniowski/Rainfall-core/commits/0997c146060047d260baf0afbffdde610df57cdf"}]}