benwtrent commented on issue #13127:
URL: https://github.com/apache/lucene/issues/13127#issuecomment-2264299983

   Ah, another option is to switch the logic that is used to mark it free and 
send it back to the freeList. We can check if the deleteQueue is advanced, and 
just unlock it instead of adding it to the list. 
   ```
     void marksAsFreeAndUnlock(DocumentsWriterPerThread state) {
       final long ramBytesUsed = state.ramBytesUsed();
       assert contains(state)
           : "we tried to add a DWPT back to the pool but the pool doesn't know 
about this DWPT";
       // If queue has advanced, we are about to flush and we don't add the 
DWPT back to the free list.
       if (state.deleteQueue.isAdvanced()) {
         state.unlock();
         return;
       }
       freeList.addAndUnlock(state, ramBytesUsed);
     }
   ```


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

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

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