Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StackOverflowError during request to ArangoDB #409

Closed
AnnieSemenova opened this issue Oct 15, 2021 · 4 comments · Fixed by #412
Closed

StackOverflowError during request to ArangoDB #409

AnnieSemenova opened this issue Oct 15, 2021 · 4 comments · Fixed by #412
Assignees
Labels

Comments

@AnnieSemenova
Copy link

Hello, colleagues!
We faced an issue during request to ArangoDB via arangodb-java-driver.
Method com.arangodb.internal.http.HttpCommunication.execute didn't exit from the recursion even after iterations were exceeded.

Prerequisites:

  • ArangoDB is deployed in Active-Failover scheme.
  • arangodb-java-driver version 6.7.5
  • HTTP_VPACK protocol is used
  • option acquireHostList is enabled
  • FallbackHostHandler as used as host handler
  • ExtendedHostResolver as used as host resolver

org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.StackOverflowError at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1006) ~[spring-webmvc-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925) ~[spring-webmvc-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:981) ~[spring-webmvc-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:884) ~[spring-webmvc-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) [javax.servlet-api-3.1.0.jar!/:3.1.0] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:858) ~[spring-webmvc-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [javax.servlet-api-3.1.0.jar!/:3.1.0] at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:873) [jetty-servlet-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1623) [jetty-servlet-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:214) [websocket-server-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610) [jetty-servlet-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:90) [spring-boot-actuator-2.0.9.RELEASE.jar!/:2.0.9.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610) [jetty-servlet-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:176) [spring-security-oauth2-2.2.3.RELEASE.jar!/:na] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:74) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) [spring-security-web-5.0.12.RELEASE.jar!/:5.0.12.RELEASE] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357) [spring-web-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270) [spring-web-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610) [jetty-servlet-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610) [jetty-servlet-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109) [spring-web-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610) [jetty-servlet-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) [spring-web-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610) [jetty-servlet-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.springframework.cloud.sleuth.instrument.web.ExceptionLoggingFilter.doFilter(ExceptionLoggingFilter.java:48) [spring-cloud-sleuth-core-2.0.2.RELEASE.jar!/:2.0.2.RELEASE] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610) [jetty-servlet-9.4.15.v20190215.jar!/:9.4.15.v20190215] at brave.servlet.TracingFilter.doFilter(TracingFilter.java:86) [brave-instrumentation-servlet-5.4.3.jar!/:na] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610) [jetty-servlet-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:117) [spring-boot-actuator-2.0.9.RELEASE.jar!/:2.0.9.RELEASE] at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:106) [spring-boot-actuator-2.0.9.RELEASE.jar!/:2.0.9.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610) [jetty-servlet-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) [spring-web-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.13.RELEASE.jar!/:5.0.13.RELEASE] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610) [jetty-servlet-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540) [jetty-servlet-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146) [jetty-server-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [jetty-security-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) [jetty-server-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257) [jetty-server-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1701) [jetty-server-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) [jetty-server-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345) [jetty-server-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) [jetty-server-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480) [jetty-servlet-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1668) [jetty-server-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) [jetty-server-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247) [jetty-server-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) [jetty-server-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) [jetty-server-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.server.Server.handle(Server.java:502) [jetty-server-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370) [jetty-server-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267) [jetty-server-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305) [jetty-io-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [jetty-io-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) [jetty-io-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333) [jetty-util-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310) [jetty-util-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) [jetty-util-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126) [jetty-util-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366) [jetty-util-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765) [jetty-util-9.4.15.v20190215.jar!/:9.4.15.v20190215] at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683) [jetty-util-9.4.15.v20190215.jar!/:9.4.15.v20190215] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212] Caused by: java.lang.StackOverflowError: null at java.util.zip.Inflater.<init>(Inflater.java:102) ~[na:1.8.0_212] at org.springframework.boot.loader.jar.ZipInflaterInputStream.<init>(ZipInflaterInputStream.java:38) ~[app.jar:6.0.0-SNAPSHOT] at org.springframework.boot.loader.jar.JarFileEntries.getInputStream(JarFileEntries.java:191) ~[app.jar:6.0.0-SNAPSHOT] at org.springframework.boot.loader.jar.JarFile.getInputStream(JarFile.java:223) ~[app.jar:6.0.0-SNAPSHOT] at org.springframework.boot.loader.jar.JarURLConnection.getInputStream(JarURLConnection.java:172) ~[app.jar:6.0.0-SNAPSHOT] at sun.misc.URLClassPath$Loader.findResource(URLClassPath.java:725) ~[na:1.8.0_212] at sun.misc.URLClassPath.findResource(URLClassPath.java:225) ~[na:1.8.0_212] at java.net.URLClassLoader$2.run(URLClassLoader.java:572) ~[na:1.8.0_212] at java.net.URLClassLoader$2.run(URLClassLoader.java:570) ~[na:1.8.0_212] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_212] at java.net.URLClassLoader.findResource(URLClassLoader.java:569) ~[na:1.8.0_212] at org.springframework.boot.loader.LaunchedURLClassLoader.findResource(LaunchedURLClassLoader.java:57) ~[app.jar:6.0.0-SNAPSHOT] at java.lang.ClassLoader.getResource(ClassLoader.java:1096) ~[na:1.8.0_212] at java.net.URLClassLoader.getResourceAsStream(URLClassLoader.java:233) ~[na:1.8.0_212] at org.apache.http.util.VersionInfo.loadVersionInfo(VersionInfo.java:233) ~[httpcore-4.4.11.jar!/:4.4.11] at org.apache.http.util.VersionInfo.getUserAgent(VersionInfo.java:319) ~[httpcore-4.4.11.jar!/:4.4.11] at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:1057) ~[httpclient-4.5.8.jar!/:4.5.8] at com.arangodb.internal.http.HttpConnection.<init>(HttpConnection.java:212) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpConnection.<init>(HttpConnection.java:75) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpConnection$Builder.build(HttpConnection.java:157) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpConnectionFactory.create(HttpConnectionFactory.java:53) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.net.ConnectionPoolImpl.createConnection(ConnectionPoolImpl.java:57) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.net.ConnectionPoolImpl.connection(ConnectionPoolImpl.java:66) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.net.HostImpl.connection(HostImpl.java:54) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:80) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na] at com.arangodb.internal.http.HttpCommunication.execute(HttpCommunication.java:106) ~[arangodb-java-driver-6.7.5.jar!/:na]

@rashtao
Copy link
Collaborator

rashtao commented Oct 15, 2021

The recursive invocation happens here:

return execute(request, new HostHandle().setHost(redirectHost));

This should only happen in case of ArangoDBRedirectException, which are only thrown in case of response code 503 and the presence of the header X-Arango-Endpoint.

Can you enable debug logging to see the actual responses from the server?

@rashtao rashtao self-assigned this Oct 15, 2021
@AnnieSemenova
Copy link
Author

We enabled debug logging, but problem reproduces from time to time.

I find the place where recursion is possible too and tried to reproduce problem manually. I tried to mock the respond from ArangoDB during debug. I emulated the scenario when request to every host in host list cause ArangoDBRedirectException.
But it works as expected, after max iterations were exceeded, ArangoDBException was thrown.
https://github.com/arangodb/arangodb-java-driver/blob/master/src/main/java/com/arangodb/internal/net/FallbackHostHandler.java#L49

We have a few parallel request to ArangoDB, maybe in such cases this logic don't work properly (e.g. incorrect parallel iterations update)?

@rashtao
Copy link
Collaborator

rashtao commented Nov 11, 2021

The cause of this behavior could be that Active Failover deployment does not allow distinguishing internal and external names for db endpoints.
In active failover all requests must be made against the leader. Requests to followers will be rejected with HTTP 503. The response will contain a Location header that indicates where the actual leader is. The Java driver automatically retries sending the request to the endpoint in the Location header.
But this header will currently use the leader's internal name/IP address, as we do not distinguish between internal and external names in active failover. So depending on the networking, hostnames resolution and routing configuration of your environment, this could lead to the problem you are facing.

To mitigate the problem and avoid StackOverflowError, I added a max retries threshold for active failover redirects after which the driver will throw an exception (#412).

@rashtao
Copy link
Collaborator

rashtao commented Nov 11, 2021

I have also created a follow-up ticket to implement a different behavior for active failover redirects:
#413

Since it is a potentially breaking change, it will be part of the next major release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants