java-driver
java-driver copied to clipboard
3.x: there is some case when driver does not release `DefaultResultSetFuture` properly
It comes from https://github.com/scylladb/cassandra-stress/issues/30.
Time to time it can stuck waiting for DefaultResultSetFuture to be released:
"Thread-2" prio=5 Id=59 WAITING on com.datastax.driver.core.DefaultResultSetFuture@2ad5ebfd
at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
- waiting on com.datastax.driver.core.DefaultResultSetFuture@2ad5ebfd
at [email protected]/java.util.concurrent.locks.LockSupport.park(Unknown Source)
at app//com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:561)
at app//com.google.common.util.concurrent.Uninterruptibles.getUninterruptibly(Uninterruptibles.java:247)
at app//com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:308)
at app//com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:58)
at app//org.apache.cassandra.stress.util.JavaDriverClient.executePrepared(JavaDriverClient.java:247)
at app//org.apache.cassandra.stress.operations.predefined.CqlOperation$JavaDriverWrapper.execute(CqlOperation.java:308)
It means that there is a bug in ReleaseHandler or in DefaultResultSetFuture that leaves DefaultResultSetFuture without set or setException called on it.
As result getUninterruptibly waits for it forever.
to go forward we need to do the following:
- Check
ReleaseHandlerandDefaultResultSetFutureto make sure every case ends up insetorsetException - Find a way for
AbstractSession.execute(Statement statement)to have timeout ongetUninterruptibly.