phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rafa <raf...@gmail.com>
Subject ConcurrentModificationException when making concurrent requests through Phoenix Query Server
Date Wed, 25 Nov 2015 16:08:09 GMT
Hi all !

We are using Apache Phoenix 4.5.2. We are making some tests from an
application server using the query server jdbc thin client driver.

When making upserts, if we use more than one client thread for making
requests we obtain this error in our client:

exception is java.sql.SQLException: exception while executing query:
response code 500
        at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:84)
        at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
        at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
        at
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:660)
        at
org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:909)
        at
org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:970)
        at
org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:980)
        at
com.xxxx.xxxxx.xxxxx.xxxxxx.poc.phoenix.PhoenixClient.put(PhoenixClient.java:127)
        at
com.xxxx.xxxxx.xxxxx.xxxxxx.poc.webapp.common.Injector.call(Injector.java:31)
        at
com.xxxx.xxxxx.xxxxx.xxxxxx.poc.webapp.common.Injector.call(Injector.java:13)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLException: exception while executing query: response
code 500
        at org.apache.calcite.avatica.Helper.createException(Helper.java:41)
        at
org.apache.calcite.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:432)
        at
org.apache.calcite.avatica.AvaticaPreparedStatement.executeUpdate(AvaticaPreparedStatement.java:118)
        at
com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:410)
        at
org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:916)
        at
org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:909)
        at
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:644)
        ... 10 more
Caused by: java.lang.RuntimeException: response code 500
        at
org.apache.calcite.avatica.remote.RemoteService.apply(RemoteService.java:45)
        at
org.apache.calcite.avatica.remote.JsonService.apply(JsonService.java:215)
        at
org.apache.calcite.avatica.remote.RemoteMeta.fetch(RemoteMeta.java:190)
        at
org.apache.calcite.avatica.MetaImpl$FetchIterator.moveNext(MetaImpl.java:809)
        at
org.apache.calcite.avatica.MetaImpl$FetchIterator.<init>(MetaImpl.java:780)
        at
org.apache.calcite.avatica.MetaImpl$FetchIterable.iterator(MetaImpl.java:758)
        at
org.apache.calcite.avatica.MetaImpl.createCursor(MetaImpl.java:98)
        at
org.apache.calcite.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:187)
        at
org.apache.calcite.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:430)
        ... 15 more


In  the Phoenix Query Server log we see these errors:

2015-11-25 15:44:52,495 WARN org.eclipse.jetty.server.HttpChannel: /
java.util.ConcurrentModificationException
        at java.util.HashMap$HashIterator.remove(HashMap.java:940)
        at
org.apache.phoenix.execute.MutationState.commit(MutationState.java:501)
        at
org.apache.phoenix.jdbc.PhoenixConnection$3.call(PhoenixConnection.java:472)
        at
org.apache.phoenix.jdbc.PhoenixConnection$3.call(PhoenixConnection.java:469)
        at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
        at
org.apache.phoenix.jdbc.PhoenixConnection.commit(PhoenixConnection.java:469)
        at
org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:323)
        at
org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:312)
        at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
        at
org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:310)
        at
org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:240)
        at
org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:173)
        at
org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:178)
        at org.apache.calcite.avatica.jdbc.JdbcMeta.fetch(JdbcMeta.java:763)
        at
org.apache.calcite.avatica.remote.LocalService.apply(LocalService.java:163)
        at
org.apache.calcite.avatica.remote.Service$FetchRequest.accept(Service.java:330)
        at
org.apache.calcite.avatica.remote.Service$FetchRequest.accept(Service.java:304)
        at
org.apache.calcite.avatica.remote.JsonHandler.apply(JsonHandler.java:43)
        at
org.apache.calcite.avatica.server.AvaticaHandler.handle(AvaticaHandler.java:55)
        at
org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
        at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
        at org.eclipse.jetty.server.Server.handle(Server.java:497)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
        at
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:245)
        at
org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
        at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
        at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
        at java.lang.Thread.run(Thread.java:745)


 Those errors only appear when there are more than one threads making
requests.

 I don't know if there is a problem with our Phoenix Query Server, which is
the default one, or there is some kind of problem when pooling connections
from an application server to the Query Server,

Thank you very much for your help,
Best Regards,
Rafa

Mime
View raw message