You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Otis Gospodnetic (JIRA)" <ji...@apache.org> on 2008/05/22 04:13:55 UTC

[jira] Resolved: (SOLR-539) Statistics variable atomicity in RequestHandlerBase

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

Otis Gospodnetic resolved SOLR-539.
-----------------------------------

    Resolution: Fixed

Merci.  I applied the volatile variation.

Committed revision 658977.


> 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.