Hi All,

I am just checking a troublesome behavior of
https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/org.apache.sling.resourceresolver-1.5.36/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java#L193

It turns out that under certain conditions (which we try to eliminate) the
corresponding index isn't available at startup and the query is executed in
a blocking way.

So my question would be:
1. Shouldn't we make filling the alias cache asynchronous?
2. In case we know that a query will be available eventually make the query
wait for index to be complete before firing?

wrt 1 - should be doable but would require some rewrite because
getAliasMap(parentPath) would need to do minitraversals when no entry is
present and search didn't complete yet as the current implementation always
assumes that aliasmap is fully initialized

wrt 2 - oak doesn't provide a corresponding service for completion but
there are ways to work with marker nodes and block with a query - I'd
suggest to make this an external service that this may be waiting for so we
can just replace this to not make resourceResolver being bound to an
implementation detail of the underlying search (while the service we
"might" be waiting for can).

WDYT?

Cheers
Dominik

P.S. a workaround certainly is to disable optimized lookup temporary until
index is there and resourceresolver as soon as available (uglyness that
this requires restart of the RR which has quite some impact).

Reply via email to