Search in sources :

Example 6 with SerializableException

use of org.voltdb.exceptions.SerializableException in project voltdb by VoltDB.

the class MpTransactionState method pollForResponses.

private FragmentResponseMessage pollForResponses() {
    FragmentResponseMessage msg = null;
    try {
        final String snapShotRestoreProcName = "@SnapshotRestore";
        while (msg == null) {
            msg = m_newDeps.poll(60L * 5, TimeUnit.SECONDS);
            if (msg == null && !snapShotRestoreProcName.equals(m_initiationMsg.getStoredProcedureName())) {
                tmLog.warn("Possible multipartition transaction deadlock detected for: " + m_initiationMsg);
                if (m_remoteWork == null) {
                    tmLog.warn("Waiting on local BorrowTask response from site: " + CoreUtils.hsIdToString(m_buddyHSId));
                } else {
                    tmLog.warn("Waiting on remote dependencies: ");
                    for (Entry<Integer, Set<Long>> e : m_remoteDeps.entrySet()) {
                        tmLog.warn("Dep ID: " + e.getKey() + " waiting on: " + CoreUtils.hsIdCollectionToString(e.getValue()));
                    }
                }
                m_mbox.send(com.google_voltpatches.common.primitives.Longs.toArray(m_useHSIds), new DumpMessage());
            }
        }
    } catch (InterruptedException e) {
        // could retry; but this is unexpected. Crash.
        throw new RuntimeException(e);
    }
    SerializableException se = msg.getException();
    if (se != null && se instanceof TransactionRestartException) {
        // If this is a restart exception, we don't need to match up the DependencyId
        setNeedsRollback(true);
        throw se;
    }
    return msg;
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) DumpMessage(org.voltdb.messaging.DumpMessage) FragmentResponseMessage(org.voltdb.messaging.FragmentResponseMessage) TransactionRestartException(org.voltdb.exceptions.TransactionRestartException) SerializableException(org.voltdb.exceptions.SerializableException)

Aggregations

SerializableException (org.voltdb.exceptions.SerializableException)6 VoltAbortException (org.voltdb.VoltProcedure.VoltAbortException)3 SpecifiedException (org.voltdb.exceptions.SpecifiedException)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 ExecutionException (java.util.concurrent.ExecutionException)2 EEException (org.voltdb.exceptions.EEException)2 FragmentResponseMessage (org.voltdb.messaging.FragmentResponseMessage)2 IOException (java.io.IOException)1 PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1 Writer (java.io.Writer)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 VoltMessage (org.voltcore.messaging.VoltMessage)1 DependencyPair (org.voltdb.DependencyPair)1 ParameterSet (org.voltdb.ParameterSet)1 SQLException (org.voltdb.exceptions.SQLException)1 TransactionRestartException (org.voltdb.exceptions.TransactionRestartException)1