ChrisHegarty opened a new pull request, #15319:
URL: https://github.com/apache/lucene/pull/15319
Fixes a potential hang with initialisation of TermsEnum and BaseTermsEnum,
by simply removing the dependency and replicating the small amount of code.
Problem description: the static `TermsEnum.EMPTY` initialises to an
implementation of `BaseTermsEnum`. `TermsEnum` is a superclass of
`BaseTermsEnum`, so there is a clear dependency between these classes. If a
subclass of `BaseTermsEnum` is initialising it may grab the lock on
`BaseTermsEnum`, and prevent `TermsEnum` from initialising. E.g.
"main" #3 [8963] prio=5 os_prio=31 cpu=30.57ms elapsed=2.19s
tid=0x0000000123815a00 nid=8963 in Object.wait() [0x000000016b24e000]
java.lang.Thread.State: RUNNABLE
at TermsEnumClinitHang.main(TermsEnumClinitHang.java:22)
- waiting on the Class initialization monitor for
org.apache.lucene.index.TermsEnum
"TEST_THREAD" #25 [27395] prio=5 os_prio=31 cpu=1.54ms elapsed=2.17s
tid=0x000000012382e800 nid=27395 in Object.wait() [0x000000016d632000]
java.lang.Thread.State: RUNNABLE
at org.apache.lucene.index.TermsEnum.<clinit>(TermsEnum.java:199)
- waiting on the Class initialization monitor for
org.apache.lucene.index.BaseTermsEnum
at TermsEnumClinitHang$1.run(TermsEnumClinitHang.java:15)
...
fixes #15317
--
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]