[
https://issues.apache.org/jira/browse/CASSANDRA-13833?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16149544#comment-16149544
]
Jay Zhuang commented on CASSANDRA-13833:
----------------------------------------
Attached the patch to change {{submit()}} to {{execute()}}, as we already
created the {{FutureTask}} for {{Runnable}}, {{submit()}} will create one more
{{FutureTask}}, which causes nested {{FutureTask}}:
{code}
public Future<?> submit(Runnable task) {
if (task == null) throw new NullPointerException();
RunnableFuture<Void> ftask = newTaskFor(task, null);
execute(ftask);
return ftask;
}
{code}
| branch | utest |
| [13833-2.2|https://github.com/cooldoger/cassandra/tree/13833-2.2] |
[!https://circleci.com/gh/cooldoger/cassandra/tree/13833-2.2.svg?style=svg!|https://circleci.com/gh/cooldoger/cassandra/tree/13833-2.2]
|
| [13833-3.0|https://github.com/cooldoger/cassandra/tree/13833-3.0] |
[!https://circleci.com/gh/cooldoger/cassandra/tree/13833-3.0.svg?style=svg!|https://circleci.com/gh/cooldoger/cassandra/tree/13833-3.0]
|
| [13833-3.11|https://github.com/cooldoger/cassandra/tree/13833-3.11] |
[!https://circleci.com/gh/cooldoger/cassandra/tree/13833-3.11.svg?style=svg!|https://circleci.com/gh/cooldoger/cassandra/tree/13833-3.11]
|
| [13833-trunk|https://github.com/cooldoger/cassandra/tree/13833-trunk] |
[!https://circleci.com/gh/cooldoger/cassandra/tree/13833-trunk.svg?style=svg!|https://circleci.com/gh/cooldoger/cassandra/tree/13833-trunk]
|
> Failed compaction is not captured
> ---------------------------------
>
> Key: CASSANDRA-13833
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13833
> Project: Cassandra
> Issue Type: Bug
> Components: Compaction
> Reporter: Jay Zhuang
> Assignee: Jay Zhuang
>
> Follow up for CASSANDRA-13785, when the compaction failed, it fails silently.
> No error message is logged and exceptions metric is not updated. Basically,
> it's unable to get the exception:
> [CompactionManager.java:1491|https://github.com/apache/cassandra/blob/cassandra-2.2/src/java/org/apache/cassandra/db/compaction/CompactionManager.java#L1491]
> Here is the call stack:
> {noformat}
> at
> org.apache.cassandra.db.compaction.CompactionTask.runMayThrow(CompactionTask.java:195)
> at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28)
> at
> org.apache.cassandra.db.compaction.CompactionTask.executeInternal(CompactionTask.java:89)
> at
> org.apache.cassandra.db.compaction.AbstractCompactionTask.execute(AbstractCompactionTask.java:61)
> at
> org.apache.cassandra.db.compaction.CompactionManager$BackgroundCompactionCandidate.run(CompactionManager.java:264)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at
> org.apache.cassandra.concurrent.NamedThreadFactory.lambda$threadLocalDeallocator$0(NamedThreadFactory.java:79)
> at java.lang.Thread.run(Thread.java:745)
> {noformat}
> There're 2 {{FutureTask}} in the call stack, for example
> {{FutureTask1(FutureTask2))}}, If the call thrown an exception,
> {{FutureTask2}} sets the status, save the exception and return. But
> FutureTask1 doesn't get any exception, then set the status to normal. So
> we're unable to get the exception in:
> [CompactionManager.java:1491|https://github.com/apache/cassandra/blob/cassandra-2.2/src/java/org/apache/cassandra/db/compaction/CompactionManager.java#L1491]
> 2.1.x is working fine, here is the call stack:
> {noformat}
> at
> org.apache.cassandra.db.compaction.CompactionTask.runMayThrow(CompactionTask.java:177)
> ~[main/:na]
> at
> org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28)
> ~[main/:na]
> at
> org.apache.cassandra.db.compaction.CompactionTask.executeInternal(CompactionTask.java:73)
> ~[main/:na]
> at
> org.apache.cassandra.db.compaction.AbstractCompactionTask.execute(AbstractCompactionTask.java:59)
> ~[main/:na]
> at
> org.apache.cassandra.db.compaction.CompactionManager$BackgroundCompactionCandidate.run(CompactionManager.java:264)
> ~[main/:na]
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> ~[na:1.8.0_141]
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> ~[na:1.8.0_141]
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> ~[na:1.8.0_141]
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> [na:1.8.0_141]
> at java.lang.Thread.run(Thread.java:748) [na:1.8.0_141]
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]