You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jonathan Ellis (JIRA)" <ji...@apache.org> on 2009/05/12 23:35:45 UTC

[jira] Reopened: (CASSANDRA-165) RejectedExecutionException in getKeyRange

     [ https://issues.apache.org/jira/browse/CASSANDRA-165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis reopened CASSANDRA-165:
--------------------------------------


[commented on 163 initially by mistake]

here is the problem

    void put(String key, ColumnFamily columnFamily, CommitLog.CommitLogContext cLogCtx) throws IOException
    {
        isDirty_ = true;
        executor_.submit(new Putter(key, columnFamily));
        if (isThresholdViolated())
        {
            enqueueFlush(cLogCtx);
        }
    }

(enqueueFlush is the one that swaps out this memtable for a new one in CFS and calls shutdown)

the problem is that we submit first and ask questions later, so we can clearly submit to this [old] memtable on one thread after another thread starts the shutdown.

the only option I see is going to back to the old double-checked-ish logic of checking threshold first, then recursing to resubmit if we switch memtables. (overriding TPE.execute/addIfUnderMaximumPoolSize is not an option since liberal use of private variables is made.)

> RejectedExecutionException in getKeyRange
> -----------------------------------------
>
>                 Key: CASSANDRA-165
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-165
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.3
>            Reporter: Jonathan Ellis
>            Assignee: Jonathan Ellis
>             Fix For: 0.3
>
>         Attachments: CASSANDRA-165.patch
>
>
> Haven't been able to repro in unit tests but fails in system tests about 50% of the time.
> java.lang.RuntimeException: java.util.concurrent.RejectedExecutionException
> 	at org.apache.cassandra.service.RangeVerbHandler.doVerb(RangeVerbHandler.java:27)
> 	at org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:46)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> 	at java.lang.Thread.run(Thread.java:619)
> Caused by: java.util.concurrent.RejectedExecutionException
> 	at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1760)
> 	at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767)
> 	at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658)
> 	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:92)
> 	at org.apache.cassandra.db.Memtable.sortedKeyIterator(Memtable.java:412)
> 	at org.apache.cassandra.db.Table.getKeyRangeUnsafe(Table.java:912)
> 	at org.apache.cassandra.db.Table.getKeyRange(Table.java:883)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.