madrob opened a new pull request #1734:
URL: https://github.com/apache/lucene-solr/pull/1734


   checkoutAndBlock is not synchronized, but has a non-atomic write to 
numPending. Meanwhile, all of the other writes to numPending are in sync 
methods.
   
   In this case it turns out to be ok because all of the code paths calling 
this method are already sync:
   
   `synchronized doAfterDocument -> checkout -> checkoutAndBlock`
   `checkoutLargestNonPendingWriter -> synchronized(this) -> checkout -> 
checkoutAndBlock`
   
   If we make synchronized checkoutAndBlock that protects us against future 
changes, shouldn't cause any performance impact since the code paths will 
already be going through a sync block, and will make an IntelliJ warning go 
away.
   
   Found via IntelliJ warnings. 
   
   https://issues.apache.org/jira/browse/LUCENE-9453
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to