[ 
https://issues.apache.org/jira/browse/SOLR-539?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Otis Gospodnetic updated SOLR-539:
----------------------------------

    Fix Version/s: 1.3
         Assignee: Otis Gospodnetic

> Statistics variable atomicity in RequestHandlerBase
> ---------------------------------------------------
>
>                 Key: SOLR-539
>                 URL: https://issues.apache.org/jira/browse/SOLR-539
>             Project: Solr
>          Issue Type: Bug
>          Components: highlighter, search, spellchecker, update
>    Affects Versions: 1.3
>            Reporter: Sean Timm
>            Assignee: Otis Gospodnetic
>            Priority: Minor
>             Fix For: 1.3
>
>         Attachments: RequestHandlerBase-AtomicLong-stats.patch, 
> RequestHandlerBase-volatile-stats.patch
>
>
> Writes are not atomic on longs unless they are volatile.   At a minimum, 
> numRequests, numErrors, and totalTime should be marked volatile.  More 
> correct, but higher overhead due to contention and synchronization would be 
> to use AtomicLong.
> There is a minor error in the calculation of avgRequestsPerSecond.  The first 
> operand of the denominator is cast to a float then has a long subtracted from 
> it, in effect casting both longs to floats then performing the subtraction.  
> It is better to do the subtraction as longs then cast to a float.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to