From 25967d0ed89446c42bb52f90b3019ce56eeb00a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20L=C3=A9aut=C3=A9?= Date: Fri, 18 Mar 2016 15:05:57 -0700 Subject: [PATCH] fix servlet startup sequence, fixes #2681 --- .../druid/server/AsyncQueryForwardingServlet.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/io/druid/server/AsyncQueryForwardingServlet.java b/server/src/main/java/io/druid/server/AsyncQueryForwardingServlet.java index d4ae69cc86c..bb09aaf3f00 100644 --- a/server/src/main/java/io/druid/server/AsyncQueryForwardingServlet.java +++ b/server/src/main/java/io/druid/server/AsyncQueryForwardingServlet.java @@ -120,6 +120,8 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet @Override public void init() throws ServletException { + super.init(); + // separate client with more aggressive connection timeouts // to prevent cancellations requests from blocking queries broadcastClient = httpClientProvider.get(); @@ -131,7 +133,17 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet } catch(Exception e) { throw new ServletException(e); } - super.init(); + } + + @Override + public void destroy() + { + super.destroy(); + try { + broadcastClient.stop(); + } catch(Exception e) { + log.warn(e, "Error stopping servlet"); + } } @Override