From: <tho...@us...> - 2013-12-19 22:09:55
|
Revision: 7686 http://bigdata.svn.sourceforge.net/bigdata/?rev=7686&view=rev Author: thompsonbry Date: 2013-12-19 22:09:49 +0000 (Thu, 19 Dec 2013) Log Message: ----------- Modified Name2Addr to report ALL exceptions if ANY of the per-dirty-index checkpoint tasks fails. Modified Paths: -------------- branches/MGC_1_3_0/bigdata/src/java/com/bigdata/journal/Name2Addr.java Modified: branches/MGC_1_3_0/bigdata/src/java/com/bigdata/journal/Name2Addr.java =================================================================== --- branches/MGC_1_3_0/bigdata/src/java/com/bigdata/journal/Name2Addr.java 2013-12-19 21:34:30 UTC (rev 7685) +++ branches/MGC_1_3_0/bigdata/src/java/com/bigdata/journal/Name2Addr.java 2013-12-19 22:09:49 UTC (rev 7686) @@ -36,6 +36,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Properties; @@ -80,6 +81,7 @@ import com.bigdata.rawstore.IRawStore; import com.bigdata.resources.IndexManager; import com.bigdata.resources.ResourceManager; +import com.bigdata.util.concurrent.ExecutionExceptions; import com.ibm.icu.text.Collator; import cutthecrap.utils.striterators.Filter; @@ -738,6 +740,7 @@ } // for each entry in the snapshot of the commit list. + final List<Throwable> causes = new LinkedList<Throwable>(); for (Future<CommitIndexTask> f : futures) { try { @@ -775,11 +778,13 @@ } catch (InterruptedException e) { - throw new RuntimeException(e); + log.error("l.name: " + e, e); + causes.add(e); } catch (ExecutionException e) { - throw new RuntimeException(e); + log.error("l.name: " + e, e); + causes.add(e); } @@ -842,6 +847,17 @@ // // set commitTime on the btree (transient field). // l.btree.setLastCommitTime(commitTime); + } // next Future. + + /* + * If there were any errors, then throw an exception listing them. + */ + if (!causes.isEmpty()) { + // Throw exception back to the leader. + if (causes.size() == 1) + throw new RuntimeException(causes.get(0)); + throw new RuntimeException("nerrors=" + causes.size(), + new ExecutionExceptions(causes)); } // and flushes out this btree as well. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |