jsedding commented on issue #6: SLING-8187 - Deadlock in SlingMainServlet after SLING-8051 URL: https://github.com/apache/sling-org-apache-sling-engine/pull/6#issuecomment-449366373 @karlpauls I have implemented your suggestion of using a CountDownLatch in the #service() method as well as moving initialization of all objects that depend on SlingServletContext into the async block. I used an arbitrary 30 second timeout to await the latch, in order to minimise damage in case of any bugs. But maybe it would be wiser to drop the timeouts. Furthermore, I wait for async initialization to complete in #deactivate(). This simplifies cleanup of resources. First tests looked promising. I noticed a (supposedly unrelated) transient error however: ``` java.lang.NullPointerException org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135) org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81) org.apache.felix.http.base.internal.dispatch.Dispatcher$1.doFilter(Dispatcher.java:147) org.apache.felix.http.base.internal.whiteboard.WhiteboardManager.invokePreprocessors(WhiteboardManager.java:1000) org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:91) org.apache.felix.http.base.internal.dispatch.DispatcherServlet.service(DispatcherServlet.java:49) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.felix.http.bridge.internal.BridgeActivator$1.service(BridgeActivator.java:83) org.apache.felix.http.proxy.ProxyServlet.service(ProxyServlet.java:123) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.sling.launchpad.base.webapp.SlingServletDelegate.service(SlingServletDelegate.java:286) org.apache.sling.launchpad.webapp.SlingServlet.service(SlingServlet.java:175) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ```
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
