Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
Description
Currently, the HST component mngr starts up possibly before the repository is running: This depends on whether first the hst or first the cms webapp starts.
This means that all HST spring beans have to be constructed such that repository access is always lazy. A typical construct then is for example instead of that a Spring bean during initialization can direct get hold of, say, the repository LockManager, it does so by for example using a supplier, where the supplier might look something like:
@Override public LockManager get() { if (lockManager != null) { return lockManager; } synchronized (lock) { if (lockManager != null) { return lockManager; } while ((lockManager = HippoServiceRegistry.getService(LockManager.class)) == null) { log.debug("{} not available yet, waiting {} {} before reattempting to get it", LockManager.class.getSimpleName(), waitMillis, MILLISECONDS); try { MILLISECONDS.sleep(waitMillis); } catch (InterruptedException e) { log.info("Interrupted while waiting for {}", LockManager.class.getSimpleName()); Thread.currentThread().interrupt(); } } } return lockManager; }
This is very unhandy. Starting up the HST Spring component manager after the repository service has become available results in that we can get rid of these kind of supplier patterns or separate threads trying until something works (like registering a jcr observer)
The fix is simple AFAICS: Postpone the HST component manager creation until the repository is available.
Only tricky part might be integration tests, where the repository initialization is triggered by a spring bean. However I think this shouldn't be that hard to fix if it turns out to be a problem.
Attachments
Issue Links
- blocks
-
HSTTWO-4199 Create a PingFilter variant to the HST PingServlet
- Closed
- is awaited by
-
HSTTWO-4165 Better support for checking site availability
- Closed
-
HSTTWO-4198 Initialize the loading of all HST configuration nodes without http request
- Closed
- is cloned by
-
HSTTWO-4324 Backport 11.2 - Postpone initializing the HST Component Manager until the RepositoryService is available
- Closed
-
HSTTWO-4325 Backport 10.2 - Postpone initializing the HST Component Manager until the RepositoryService is available
- Closed
-
HSTTWO-4328 Backport 11.2 - Postpone initializing the HST Component Manager until the RepositoryService is available
- Closed
-
HSTTWO-4329 backport 10.2 - Postpone initializing the HST Component Manager until the RepositoryService is available
- Closed
- relates to
-
HSTTWO-3472 Support HST Container Loading (currently done by HstSiteConfigServlet) in earlier phase for more accessibility
- Closed
-
HSTTWO-4200 Support better graceful destroy of the HST Spring component manager
- Closed
-
CMS-12905 Support setting the root spring app context as parent of the HST spring context
- Open