druid icon indicating copy to clipboard operation
druid copied to clipboard

DruidAvaticaHandlerTest transient failure (times out)

Open himanshug opened this issue 8 years ago • 6 comments

himanshug avatar Dec 20 '17 18:12 himanshug

another failure...

1:40:14 Running io.druid.sql.avatica.DruidAvaticaHandlerTest
21:40:21 Tests run: 22, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 7.331 sec <<< FAILURE! - in io.druid.sql.avatica.DruidAvaticaHandlerTest
21:40:21 testConcurrentQueries(io.druid.sql.avatica.DruidAvaticaHandlerTest)  Time elapsed: 0.21 sec  <<< ERROR!
21:40:21 java.util.concurrent.ExecutionException: 
21:40:21 AvaticaClientRuntimeException: Remote driver error: ISE: Connection[c767347d-44e8-410a-a14f-e5e9492a5e56] already open.. Error -1 (00000) UNKNOWN
21:40:21 
21:40:21 io.druid.java.util.common.ISE: Connection[c767347d-44e8-410a-a14f-e5e9492a5e56] already open.
21:40:21 	at io.druid.sql.avatica.DruidMeta.openDruidConnection(DruidMeta.java:557)
21:40:21 	at io.druid.sql.avatica.DruidMeta.openConnection(DruidMeta.java:111)
21:40:21 	at org.apache.calcite.avatica.remote.LocalService.apply(LocalService.java:285)
21:40:21 	at org.apache.calcite.avatica.remote.Service$OpenConnectionRequest.accept(Service.java:1771)
21:40:21 	at org.apache.calcite.avatica.remote.Service$OpenConnectionRequest.accept(Service.java:1751)
21:40:21 	at org.apache.calcite.avatica.remote.AbstractHandler.apply(AbstractHandler.java:94)
21:40:21 	at org.apache.calcite.avatica.remote.JsonHandler.apply(JsonHandler.java:52)
21:40:21 	at org.apache.calcite.avatica.server.AvaticaJsonHandler.handle(AvaticaJsonHandler.java:130)
21:40:21 	at io.druid.sql.avatica.DruidAvaticaHandler.handle(DruidAvaticaHandler.java:60)
21:40:21 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
21:40:21 	at org.eclipse.jetty.server.Server.handle(Server.java:534)
21:40:21 	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
21:40:21 	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
21:40:21 	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283)
21:40:21 	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108)
21:40:21 	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
21:40:21 	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
21:40:21 	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
21:40:21 	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
21:40:21 	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
21:40:21 	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
21:40:21 	at java.lang.Thread.run(Thread.java:745)
21:40:21 
21:40:21 
21:40:21 	at io.druid.sql.avatica.DruidAvaticaHandlerTest.testConcurrentQueries(DruidAvaticaHandlerTest.java:568)
21:40:21 Caused by: org.apache.calcite.avatica.AvaticaClientRuntimeException: Remote driver error: ISE: Connection[c767347d-44e8-410a-a14f-e5e9492a5e56] already open.
21:40:21 	at io.druid.sql.avatica.DruidAvaticaHandlerTest.lambda$testConcurrentQueries$0(DruidAvaticaHandlerTest.java:555)
21:40:21 
21:40:21 
21:40:21 Results :
21:40:21 
21:40:21 Tests in error: 
21:40:21   DruidAvaticaHandlerTest.testConcurrentQueries:568 » Execution AvaticaClientRun...

himanshug avatar Dec 20 '17 22:12 himanshug

@himanshug I still get this error https://github.com/apache/druid/issues/5183#issuecomment-353203960. Not facing this issue when only one broker is up and running. But when we increase the replica count to 2, queries from our BI tool(looker, connects using jdbc) fail with Connection already open error.

Aka-shi avatar May 18 '20 00:05 Aka-shi

@himanshug I still get this error #5183 (comment). Not facing this issue when only one broker is up and running. But when we increase the replica count to 2, queries from our BI tool(looker, connects using jdbc) fail with Connection already open error.

Ran into this issue as well @himanshug

"Druid's JDBC server does not share connection state between Brokers. This means that if you're using JDBC and have multiple Druid Brokers, you should either connect to a specific Broker, or use a load balancer with sticky sessions enabled. The Druid Router process provides connection stickiness when balancing JDBC requests, and can be used to achieve the necessary stickiness even with a normal non-sticky load balancer."

I tried sticky, didnt help but sending looker to the router process did help

NelsonJeppesen avatar Dec 02 '20 17:12 NelsonJeppesen

I tried sticky, didnt help but sending looker to the router process did help

Are you sure your load balancer stickiness would be sticky based on the "connectionId" .. that is what router uses and since router works, I am more inclined to guess that it is working as designed.

there is a corner case though, when set of brokers change (i.e. some brokers are removed/added) then the mapping (connectionId -> brokerHost) might change and could cause some issues temporarily I think.

that said, I am not super familiar with this side of the code or used any BI tools on Druid. so my analysis may not be very accurate.

himanshug avatar Dec 03 '20 00:12 himanshug

Sorry @himanshug, I intended to ping @Aka-shi about my findings

But to answer your question, almost certainly not. All I did was a quick 5 min test with generic ALB stickiness. without any Druid specific configuration. It did not work, so I switched to using the router role almost immediately. I can't speak to @Aka-shi needs, but I consider this working and acceptable for my needs with Looker

NelsonJeppesen avatar Dec 03 '20 02:12 NelsonJeppesen

does this issue fixed or not?

SmaatoDataTeam avatar Jul 13 '23 10:07 SmaatoDataTeam