HSEARCH-2240 Query of the wrong type being generated during parallel … #1078
Running elasticsearch queries in parallel would attempt to lookup the Query Translator service in parallel.
Parallel service lookups would attempt to iterate on the ORM's ClassloaderService, which doesn't enumerate service implementors in a threadsafe way.
The result is that "some" threads would fail to find the translator service implementation, fall back to "null", which is then handled by the query execution code as a "no need for translation" and it eventually attempts to run the Lucene query - eventually it fails to run the Lucene query on the ES IndexManager.
Seems like an old bug, specifically in the ORM ClassLoader wrapper, although all consumers of it normally wouldn't lookup a service at runtime: using the service lookup sequentially at bootstrap as we normally do doesn't trigger the issue.
Not yet, was wondering what you'd think of it. Clearly HHH's service management is not designed to be threadsafe - somehow we assumed it would from a Search perspective.
With this fix, it's not going to bother us anymore.
I'll open one so we can see if the ORM teams wants to fix it or add some comment/warning.