Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-1250

AJAX requests temporarily hang if behind proxy

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 1.3.0-rc-1, 1.3.0-rc-2
    • Fix Version/s: 2.0.0
    • Component/s: Web UI
    • Labels:
      None
    • Environment:

      JRE 1.5, embedded Jetty

      Description

      After performing a fresh install on a Linux machine behind a proxy, the app starts up fine but then the UI hangs once an AJAX request is made. The UI becomes responsive after a few minutes again and then AJAX requests work fine, though if AJAX requests keep being made before the first one completes then it appears things queue up and the server remains hung even longer.

      Here's the interesting stuff from the main log file (going to the home page and trying to log in):

      2008-12-30 12:32:33,194 [DEBUG] (o.a.w.s.RepoFilter :80) - Entering request 15409211: /webapp/home.htmlwicket:interface=:0:welcomeBorder:latestLabel::IActivePageBehaviorListener:0:&wicket:ignoreIfNotActive=true&random=0.23915043457884982
      2008-12-30 12:32:33,277 [DEBUG] (o.a.c.h.p.DefaultHttpParams:151) - Set parameter http.socket.timeout = 15000
      2008-12-30 12:32:33,278 [DEBUG] (o.a.c.h.p.DefaultHttpParams:151) - Set parameter http.method.retry-handler = org.apache.commons.httpclient.DefaultHttpMethodRetryHandler@1efa79f
      2008-12-30 12:32:33,291 [DEBUG] (o.a.c.h.HttpConnection:692) - Open connection to service.jfrog.org:80
      ...
      2008-12-30 12:32:48,718 [DEBUG] (o.a.w.s.RepoFilter :80) - Entering request 13921173: /webapp/login.htmlwicket:interface=:1:loginBorder:loginPanel:buttons:submit::IActivePageBehaviorListener:0:&wicket:ignoreIfNotActive=true&random=0.7070751499486561
      2008-12-30 12:35:42,369 [DEBUG] (o.a.c.h.HttpMethodDirector:404) - Closing the connection.
      2008-12-30 12:35:42,371 [INFO ] (o.a.c.h.HttpMethodDirector:439) - I/O exception (java.net.ConnectException) caught when processing request: Connection timed out
      2008-12-30 12:35:42,389 [DEBUG] (o.a.c.h.HttpMethodDirector:443) - Connection timed out
      java.net.ConnectException: Connection timed out
      at java.net.PlainSocketImpl.socketConnect(Native Method) [na:1.5.0_02]
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) [na:1.5.0_02]
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) [na:1.5.0_02]
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) [na:1.5.0_02]
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364) [na:1.5.0_02]
      at java.net.Socket.connect(Socket.java:507) [na:1.5.0_02]
      at java.net.Socket.connect(Socket.java:457) [na:1.5.0_02]
      at java.net.Socket.<init>(Socket.java:365) [na:1.5.0_02]
      at java.net.Socket.<init>(Socket.java:238) [na:1.5.0_02]
      at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80) [commons-httpclient-3.1.jar:na]
      at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122) [commons-httpclient-3.1.jar:na]
      at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707) [commons-httpclient-3.1.jar:na]
      at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387) [commons-httpclient-3.1.jar:na]
      at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) [commons-httpclient-3.1.jar:na]
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) [commons-httpclient-3.1.jar:na]
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323) [commons-httpclient-3.1.jar:na]
      at org.artifactory.version.VersionInfoServiceImpl.getRemote(VersionInfoServiceImpl.java:140) [artifactory-core-1.3.0-rc-2.jar:na]
      at org.artifactory.version.VersionInfoServiceImpl.getVersioning(VersionInfoServiceImpl.java:83) [artifactory-core-1.3.0-rc-2.jar:na]
      at org.artifactory.version.VersionInfoServiceImpl.getLatestVersion(VersionInfoServiceImpl.java:52) [artifactory-core-1.3.0-rc-2.jar:na]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.5.0_02]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [na:1.5.0_02]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [na:1.5.0_02]
      at java.lang.reflect.Method.invoke(Method.java:585) [na:1.5.0_02]
      at org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:416) [wicket-ioc-1.3.5.jar:1.3.5]
      at org.apache.wicket.proxy.$Proxy78.getLatestVersion(Unknown Source) [na:1.3.5]
      at org.artifactory.webapp.wicket.page.home.WelcomeBorder$1.onTimer(WelcomeBorder.java:111) [classes/:na]
      at org.apache.wicket.ajax.AbstractAjaxTimerBehavior.respond(AbstractAjaxTimerBehavior.java:155) [wicket-1.3.5.jar:1.3.5]
      at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:297) [wicket-1.3.5.jar:1.3.5]
      at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:100) [wicket-1.3.5.jar:1.3.5]
      at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91) [wicket-1.3.5.jar:1.3.5]
      at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1175) [wicket-1.3.5.jar:1.3.5]
      at org.apache.wicket.RequestCycle.step(RequestCycle.java:1252) [wicket-1.3.5.jar:1.3.5]
      at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1353) [wicket-1.3.5.jar:1.3.5]
      at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) [wicket-1.3.5.jar:1.3.5]
      at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:355) [wicket-1.3.5.jar:1.3.5]
      at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:200) [wicket-1.3.5.jar:1.3.5]
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115) [jetty-6.1.14.jar:6.1.14]
      at org.artifactory.webapp.servlet.RepoFilter.execute(RepoFilter.java:153) [classes/:na]
      at org.artifactory.webapp.servlet.RepoFilter.doFilter(RepoFilter.java:73) [classes/:na]
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115) [jetty-6.1.14.jar:6.1.14]
      at org.artifactory.webapp.servlet.AccessFilter.doFilterInternal(AccessFilter.java:124) [classes/:na]
      at org.artifactory.webapp.servlet.AccessFilter.doFilter(AccessFilter.java:90) [classes/:na]
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115) [jetty-6.1.14.jar:6.1.14]
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:361) [jetty-6.1.14.jar:6.1.14]
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) [jetty-6.1.14.jar:6.1.14]
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) [jetty-6.1.14.jar:6.1.14]
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) [jetty-6.1.14.jar:6.1.14]
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) [jetty-6.1.14.jar:6.1.14]
      at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) [jetty-6.1.14.jar:6.1.14]
      at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) [jetty-6.1.14.jar:6.1.14]
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) [jetty-6.1.14.jar:6.1.14]
      at org.mortbay.jetty.Server.handle(Server.java:324) [jetty-6.1.14.jar:6.1.14]
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) [jetty-6.1.14.jar:6.1.14]
      at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864) [jetty-6.1.14.jar:6.1.14]
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533) [jetty-6.1.14.jar:6.1.14]
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207) [jetty-6.1.14.jar:6.1.14]
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403) [jetty-6.1.14.jar:6.1.14]
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) [jetty-6.1.14.jar:6.1.14]
      at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451) [jetty-util-6.1.14.jar:6.1.14]
      2008-12-30 12:35:42,423 [INFO ] (o.a.c.h.HttpMethodDirector:445) - Retrying request
      2008-12-30 12:35:42,424 [DEBUG] (o.a.c.h.HttpConnection:692) - Open connection to service.jfrog.org:80
      2008-12-30 12:38:51,400 [DEBUG] (o.a.c.h.HttpMethodDirector:404) - Closing the connection.
      2008-12-30 12:38:51,401 [DEBUG] (o.a.c.h.HttpMethodDirector:434) - Method retry handler returned false. Automatic recovery will not be attempted
      2008-12-30 12:38:51,402 [DEBUG] (o.a.c.h.HttpConnection:1178) - Releasing connection back to connection manager.
      2008-12-30 12:38:51,429 [DEBUG] (o.a.w.s.RepoFilter :157) - Exiting request 15409211: /webapp/home.htmlwicket:interface=:0:welcomeBorder:latestLabel::IActivePageBehaviorListener:0:&wicket:ignoreIfNotActive=true&random=0.23915043457884982
      ...
      2008-12-30 12:38:51,566 [DEBUG] (o.a.w.s.RepoFilter :157) - Exiting request 13921173: /webapp/login.htmlwicket:interface=:1:loginBorder:loginPanel:buttons:submit::IActivePageBehaviorListener:0:&wicket:ignoreIfNotActive=true&random=0.7070751499486561

      It looks like Wicket might queue up all AJAX requests for a single browser session, and thus no AJAX requests work until that initial latestLabel request finishes. The reason that particular request is taking forever is likely because my machine is behind a proxy (or service.jfrog.org is slow) and the HTTP request being made is using the default 3min timeout (you're calling setSoTimeout on HttpClientParams in VersionInfoServiceImpl, but not the more important setConnectionTimeout) along with a retry.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                yossis Yossi Shaul
                Reporter:
                igx89 Matthew Lieder
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: