drabe8 opened a new issue, #15119:
URL: https://github.com/apache/lucene/issues/15119

   ### Description
   
   Similar to https://github.com/apache/lucene/issues/12419
   
   In our use case, we create many IndexWriters on the fly, dependent on the 
workload assigned to our process. (We use a ByteBuffersDirectory to create 
discrete indexes for a small subset of the data that a given user is working 
with.)
   
   We see one thread constructing an IndexWriterConfig, waiting for the 
IndexWriter Class Init monitor:
   ```
      java.lang.Thread.State: RUNNABLE
        at java.lang.Class.forName0([email protected]/Native Method)
        - waiting on the Class initialization monitor for 
org.apache.lucene.index.IndexWriter
        at java.lang.Class.forName([email protected]/Class.java:421)
        at java.lang.Class.forName([email protected]/Class.java:412)
        at 
org.apache.lucene.internal.tests.TestSecrets.lambda$static$0(TestSecrets.java:43)
        at 
org.apache.lucene.internal.tests.TestSecrets$$Lambda/0x00007ff82101b458.accept(Unknown
 Source)
        at 
org.apache.lucene.internal.tests.TestSecrets.<clinit>(TestSecrets.java:51)
        at 
org.apache.lucene.index.ConcurrentMergeScheduler.<clinit>(ConcurrentMergeScheduler.java:939)
        at 
org.apache.lucene.index.LiveIndexWriterConfig.<init>(LiveIndexWriterConfig.java:130)
        at 
org.apache.lucene.index.IndexWriterConfig.<init>(IndexWriterConfig.java:145)
   ```
   
   And another thread constructing an IndexWriter, waiting for the TestSecrets 
Class Init monitor:
   ```
      java.lang.Thread.State: RUNNABLE
        at org.apache.lucene.index.IndexWriter.<clinit>(IndexWriter.java:6597)
        - waiting on the Class initialization monitor for 
org.apache.lucene.internal.tests.TestSecrets
   ```
   
   And thousands of threads are stuck trying to create an IndexWriterConfig, 
stuck waiting for the ConcurrentMergeScheduler Class Init monitor:
   ```
      java.lang.Thread.State: RUNNABLE
        at 
org.apache.lucene.index.LiveIndexWriterConfig.<init>(LiveIndexWriterConfig.java:130)
        - waiting on the Class initialization monitor for 
org.apache.lucene.index.ConcurrentMergeScheduler
        at 
org.apache.lucene.index.IndexWriterConfig.<init>(IndexWriterConfig.java:145)
   ```
   
   I believe this is a legitimate use case; when the deadlock occurs, it is a 
major problem for us.
   
   ### Version and environment details
   
   Lucene 10.2.2
   Java 21.0.7


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to