You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Dejan Bosanac (JIRA)" <ji...@apache.org> on 2011/04/06 12:25:05 UTC

[jira] [Created] (AMQ-3272) Handle RejectedExecutionException

Handle RejectedExecutionException 
----------------------------------

                 Key: AMQ-3272
                 URL: https://issues.apache.org/jira/browse/AMQ-3272
             Project: ActiveMQ
          Issue Type: Improvement
    Affects Versions: 5.5.0
            Reporter: Dejan Bosanac
            Assignee: Dejan Bosanac
             Fix For: 5.6.0


Under heavy load, the async task executor in kahadb can throw RejectedExecutionException meaning it can't accept more tasks.

Thread pool executor has RejectedExecutionHandler that deals with these situations and by default it aborts the task and throws the exception. I think it's much better to use ThreadPoolExecutor.CallerRunsPolicy which will try to execute the task in the current thread and thus sync the execution.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (AMQ-3272) Handle RejectedExecutionException

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3272?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Tully resolved AMQ-3272.
-----------------------------

    Resolution: Fixed

fix is in http://svn.apache.org/viewvc?rev=1102014&view=rev

when an async task was canceled the semaphore bounding the task queue was signaled in error. That should only be signaled when the task has completed, due to the preceding cancel it will have nothing to do, but it consumes space in the task queue.

> Handle RejectedExecutionException 
> ----------------------------------
>
>                 Key: AMQ-3272
>                 URL: https://issues.apache.org/jira/browse/AMQ-3272
>             Project: ActiveMQ
>          Issue Type: Improvement
>    Affects Versions: 5.5.0
>            Reporter: Dejan Bosanac
>            Assignee: Gary Tully
>             Fix For: 5.6.0
>
>
> Under heavy load, the async task executor in kahadb can throw RejectedExecutionException meaning it can't accept more tasks.
> Thread pool executor has RejectedExecutionHandler that deals with these situations and by default it aborts the task and throws the exception. I think it's much better to use ThreadPoolExecutor.CallerRunsPolicy which will try to execute the task in the current thread and thus sync the execution.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (AMQ-3272) Handle RejectedExecutionException

Posted by "Dejan Bosanac (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3272?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dejan Bosanac resolved AMQ-3272.
--------------------------------

    Resolution: Fixed

Should be fixed with svn revision 1090186.

The problem that exception occurred in the first place was the semaphore lock releasing at the end of the task, leaving the small window when executor could accept new tasks while there's no space available. With this fixed, the exception shouldn't happen even under high load.

> Handle RejectedExecutionException 
> ----------------------------------
>
>                 Key: AMQ-3272
>                 URL: https://issues.apache.org/jira/browse/AMQ-3272
>             Project: ActiveMQ
>          Issue Type: Improvement
>    Affects Versions: 5.5.0
>            Reporter: Dejan Bosanac
>            Assignee: Dejan Bosanac
>             Fix For: 5.6.0
>
>
> Under heavy load, the async task executor in kahadb can throw RejectedExecutionException meaning it can't accept more tasks.
> Thread pool executor has RejectedExecutionHandler that deals with these situations and by default it aborts the task and throws the exception. I think it's much better to use ThreadPoolExecutor.CallerRunsPolicy which will try to execute the task in the current thread and thus sync the execution.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (AMQ-3272) Handle RejectedExecutionException

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3272?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Tully updated AMQ-3272:
----------------------------

        Labels: kahaDB queue  (was: )
    Issue Type: Bug  (was: Improvement)

aborting the task is really a bug as a semaphore is engaged to gate the task queue.

> Handle RejectedExecutionException 
> ----------------------------------
>
>                 Key: AMQ-3272
>                 URL: https://issues.apache.org/jira/browse/AMQ-3272
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.5.0
>            Reporter: Dejan Bosanac
>            Assignee: Gary Tully
>              Labels: kahaDB, queue
>             Fix For: 5.6.0
>
>
> Under heavy load, the async task executor in kahadb can throw RejectedExecutionException meaning it can't accept more tasks.
> Thread pool executor has RejectedExecutionHandler that deals with these situations and by default it aborts the task and throws the exception. I think it's much better to use ThreadPoolExecutor.CallerRunsPolicy which will try to execute the task in the current thread and thus sync the execution.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AMQ-3272) Handle RejectedExecutionException

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13016780#comment-13016780 ] 

Gary Tully commented on AMQ-3272:
---------------------------------

just at thought, this might effect the send order, in that the last task gets executed ahead of pending tasks.
Would it be better if that send blocked pending the execution of the tasks ahead of it.
so use a fixed size blocking task pool and have the number of workers configurable.

> Handle RejectedExecutionException 
> ----------------------------------
>
>                 Key: AMQ-3272
>                 URL: https://issues.apache.org/jira/browse/AMQ-3272
>             Project: ActiveMQ
>          Issue Type: Improvement
>    Affects Versions: 5.5.0
>            Reporter: Dejan Bosanac
>            Assignee: Dejan Bosanac
>             Fix For: 5.6.0
>
>
> Under heavy load, the async task executor in kahadb can throw RejectedExecutionException meaning it can't accept more tasks.
> Thread pool executor has RejectedExecutionHandler that deals with these situations and by default it aborts the task and throws the exception. I think it's much better to use ThreadPoolExecutor.CallerRunsPolicy which will try to execute the task in the current thread and thus sync the execution.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Reopened] (AMQ-3272) Handle RejectedExecutionException

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3272?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Tully reopened AMQ-3272:
-----------------------------

      Assignee: Gary Tully  (was: Dejan Bosanac)

The rejected execution exception still occurs, problem seems to be early release of locks in the cancel case.

> Handle RejectedExecutionException 
> ----------------------------------
>
>                 Key: AMQ-3272
>                 URL: https://issues.apache.org/jira/browse/AMQ-3272
>             Project: ActiveMQ
>          Issue Type: Improvement
>    Affects Versions: 5.5.0
>            Reporter: Dejan Bosanac
>            Assignee: Gary Tully
>             Fix For: 5.6.0
>
>
> Under heavy load, the async task executor in kahadb can throw RejectedExecutionException meaning it can't accept more tasks.
> Thread pool executor has RejectedExecutionHandler that deals with these situations and by default it aborts the task and throws the exception. I think it's much better to use ThreadPoolExecutor.CallerRunsPolicy which will try to execute the task in the current thread and thus sync the execution.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira