Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dcache-history: avoid NaN stack trace in histogram conversion
Motivation: See GH #6978 NaN error in history service #6978 The stack trace comes when the Gson writer attempts to serialize a double NaN. Modification: While it has been difficult to reproduce the conditions giving rise to this error, there are a number of possible places where NaNs can occur in the histogram pipeline. These all involve division where either numerator or denominator are a floating point value and they both are zero. (a NaN can also occur from the modulo operation if done using a floating point zero value, but there are no instances of % + fp that I could find). To prevent this, those places are wrapped in a utility method that converts the NaN to a zero. As extra prevention, we do the same when adding a double value to a timeseries histogram. Result: The code should not generate the reported exception. Target: master Request: 8.2 Request: 8.1 Request: 8.0 Request: 7.2 Requires-notes: yes Patch: https://rb.dcache.org/r/13867/ Closes: #6978 Acked-by: Dmitry
- Loading branch information
Showing
5 changed files
with
28 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters