Increase Cassandra-related timeouts
wilkinsona opened this issue · 0 comments
wilkinsona commented
Cassandra's rather slow in our CI environment so we need to tune the app to avoid failures like this:
Caused by: org.springframework.data.cassandra.CassandraUncategorizedException: Query; CQL [CREATE TABLE orders (id text, customerid text, createdat timestamp, createdby text, items list<frozen<tuple<text, double, int>>>, modifiedat timestamp, modifiedby text, order_date timestamp, PRIMARY KEY (id, customerid)) WITH CLUSTERING ORDER BY (customerid ASC);]; Query timed out after PT2S
at org.springframework.data.cassandra.core.cql.CassandraExceptionTranslator.translate(CassandraExceptionTranslator.java:156) ~[spring-data-cassandra-4.0.0.jar!/:4.0.0]
at org.springframework.data.cassandra.core.cql.CassandraAccessor.translate(CassandraAccessor.java:422) ~[spring-data-cassandra-4.0.0.jar!/:4.0.0]
at org.springframework.data.cassandra.core.cql.CqlTemplate.translateException(CqlTemplate.java:551) ~[spring-data-cassandra-4.0.0.jar!/:4.0.0]
at org.springframework.data.cassandra.core.cql.CqlTemplate.query(CqlTemplate.java:166) ~[spring-data-cassandra-4.0.0.jar!/:4.0.0]
at org.springframework.data.cassandra.core.cql.CqlTemplate.queryForResultSet(CqlTemplate.java:211) ~[spring-data-cassandra-4.0.0.jar!/:4.0.0]
at org.springframework.data.cassandra.core.cql.CqlTemplate.execute(CqlTemplate.java:145) ~[spring-data-cassandra-4.0.0.jar!/:4.0.0]
at org.springframework.data.cassandra.core.CassandraPersistentEntitySchemaCreator.lambda$createTables$0(CassandraPersistentEntitySchemaCreator.java:101) ~[spring-data-cassandra-4.0.0.jar!/:4.0.0]
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[na:na]
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[na:na]
at org.springframework.data.cassandra.core.CassandraPersistentEntitySchemaCreator.createTables(CassandraPersistentEntitySchemaCreator.java:101) ~[spring-data-cassandra-4.0.0.jar!/:4.0.0]
at org.springframework.data.cassandra.config.SessionFactoryFactoryBean.performSchemaActions(SessionFactoryFactoryBean.java:251) ~[spring-data-cassandra-4.0.0.jar!/:4.0.0]
at org.springframework.data.cassandra.config.SessionFactoryFactoryBean.createTables(SessionFactoryFactoryBean.java:230) ~[spring-data-cassandra-4.0.0.jar!/:4.0.0]
at org.springframework.data.cassandra.config.SessionFactoryFactoryBean.performSchemaAction(SessionFactoryFactoryBean.java:216) ~[spring-data-cassandra-4.0.0.jar!/:4.0.0]
at org.springframework.data.cassandra.config.SessionFactoryFactoryBean.lambda$afterPropertiesSet$0(SessionFactoryFactoryBean.java:153) ~[spring-data-cassandra-4.0.0.jar!/:4.0.0]
at org.springframework.data.cassandra.config.SchemaUtils.withAsyncSchemaRefresh(SchemaUtils.java:96) ~[spring-data-cassandra-4.0.0.jar!/:4.0.0]
at org.springframework.data.cassandra.config.SchemaUtils.withSchemaRefresh(SchemaUtils.java:84) ~[spring-data-cassandra-4.0.0.jar!/:4.0.0]
at org.springframework.data.cassandra.config.SessionFactoryFactoryBean.afterPropertiesSet(SessionFactoryFactoryBean.java:159) ~[spring-data-cassandra-4.0.0.jar!/:4.0.0]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1797) ~[spring-beans-6.0.2.jar!/:6.0.2]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1747) ~[spring-beans-6.0.2.jar!/:6.0.2]
... 64 common frames omitted
Caused by: com.datastax.oss.driver.api.core.DriverTimeoutException: Query timed out after PT2S
at com.datastax.oss.driver.api.core.DriverTimeoutException.copy(DriverTimeoutException.java:34) ~[java-driver-core-4.15.0.jar!/:na]
at com.datastax.oss.driver.internal.core.util.concurrent.CompletableFutures.getUninterruptibly(CompletableFutures.java:149) ~[java-driver-core-4.15.0.jar!/:na]
at com.datastax.oss.driver.internal.core.cql.CqlRequestSyncProcessor.process(CqlRequestSyncProcessor.java:53) ~[java-driver-core-4.15.0.jar!/:na]
at com.datastax.oss.driver.internal.core.cql.CqlRequestSyncProcessor.process(CqlRequestSyncProcessor.java:30) ~[java-driver-core-4.15.0.jar!/:na]
at com.datastax.oss.driver.internal.core.session.DefaultSession.execute(DefaultSession.java:230) ~[java-driver-core-4.15.0.jar!/:na]
at com.datastax.oss.driver.api.core.cql.SyncCqlSession.execute(SyncCqlSession.java:54) ~[java-driver-core-4.15.0.jar!/:na]
at org.springframework.data.cassandra.core.cql.CqlTemplate.query(CqlTemplate.java:162) ~[spring-data-cassandra-4.0.0.jar!/:4.0.0]
... 86 common frames omitted
We can probably copy some settings from Boot's Cassandra-based integration tests.