GitHub user viirya opened a pull request:

    https://github.com/apache/spark/pull/10267

    [SPARK-12276][Core] Prevent RejectedExecutionException by checking if 
ThreadPoolExecutor is shutdown and its capacity

    JIRA: https://issues.apache.org/jira/browse/SPARK-12276
    
    We noticed that it is possible to throw RejectedExecutionException when 
submitting thread in AppClient. The error is like following. We should add some 
checks to prevent it.
    
        java.util.concurrent.RejectedExecutionException: Task 
java.util.concurrent.FutureTask@2077082c rejected from 
java.util.concurrent.ThreadPoolExecutor@66b9915a[Running, pool size = 1, active 
threads     = 0, queued tasks = 0, completed tasks = 1]
        at 
java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048)
        at 
java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821)
        at 
java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372)
        at 
java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:110)
        at 
org.apache.spark.deploy.client.AppClient$ClientEndpoint$$anonfun$tryRegisterAllMasters$1.apply(AppClient.scala:96)
        ...

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/viirya/spark-1 fix-reject-execution-exception

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/10267.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #10267
    
----
commit d8fc88d19fd68b3cb9b34f34a5a624fe26b31c12
Author: Liang-Chi Hsieh <vii...@appier.com>
Date:   2015-12-11T06:18:53Z

    Prevent RejectedExecutionException by checking if ThreadPoolExecutor is 
shutdown and its capacity.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to