[jboss-jira] [JBoss JIRA] (WFLY-11328) EE Concurency Utilities "hung-task-threshold" / "long-running-tasks" do not work and are not implemented as explained

James Perkins (Jira) issues at jboss.org
Tue Jul 30 17:04:00 EDT 2019


    [ https://issues.jboss.org/browse/WFLY-11328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13764954#comment-13764954 ] 

James Perkins commented on WFLY-11328:
--------------------------------------

I did a quick search in the spec and it says:
{quote}
*3.2.5 System  Administrator’s  Responsibilities*
The System Administrator (EE.2.110.5) is responsible for monitoring and overseeing the runtime environment.
In the scope of this specification, these duties may include:
* Monitoring for hung tasks.
* Monitoring resource usage (for example, threads and memory).
{quote}

It doesn't indicate how an administrator would do that or the fact that it's required to monitor for a hung thread. Deprecation is the simplest approach IMO.

Another option would be to extend or expose the {{ManagedThread.isTaskHun()}} in a custom {{Future}} and leave the checking up to the user.

> EE Concurency Utilities "hung-task-threshold" / "long-running-tasks" do not work and are not implemented as explained
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: WFLY-11328
>                 URL: https://issues.jboss.org/browse/WFLY-11328
>             Project: WildFly
>          Issue Type: Bug
>          Components: EE
>            Reporter: Jiri Ondrusek
>            Assignee: Jiri Ondrusek
>            Priority: Major
>
> ee subsystem parameters "hung-task-threshold" and "long-running-tasks" for managed-executor-service / managed-scheduled-executor-service do not work and are not implemented as described in [EAP 7 Development Guide|https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html/development_guide/concurrency_utilities#managed_executor_service]:
>  - hung-task-threshold: Defines the time, in milliseconds, after which tasks are considered hung by the managed executor service and forcefully aborted. If the value is 0 (which is the default), tasks are never considered hung.
>  - long-running-tasks: Suggests optimizing the execution of long running tasks, and defaults to false.
> I tested with [EAP 7 QuickStarts managed-executor-service example|https://github.com/jboss-developer/jboss-eap-quickstarts/tree/7.0.0.Final/managed-executor-service] but these paremeters doe not take any effect:
>  - tasks exceeding hung-task-threshold are never forcefully aborted. And there's no way to detect hung tasks exceeding hung-task-threshold. 
>  - setting long-running-tasks to true does not change the behavior.
> As far as I checked the source code, I noticed the following:
>  - EAP 7.x uses the EE Concurency Utilities RI [org.glassfish.enterprise.concurrent|https://github.com/javaee/cu-ri] internally and just passes the paramters to the RI. 
>  - In the EE Concurency Utilities RI, these parameters are used in the methods [ManagedThreadFactoryImpl#isTaskHung(long now)|https://github.com/javaee/cu-ri/blob/master/src/main/java/org/glassfish/enterprise/concurrent/ManagedThreadFactoryImpl.java#L294-L299], [AbstractManagedExecutorService#getHungThreads()|https://github.com/javaee/cu-ri/blob/master/src/main/java/org/glassfish/enterprise/concurrent/AbstractManagedExecutorService.java#L183-L201] and [AbstractManagedExecutorService#isLongRunningTasks()|https://github.com/javaee/cu-ri/blob/master/src/main/java/org/glassfish/enterprise/concurrent/AbstractManagedExecutorService.java#L211-L213] (AbstractManagedExecutorService is the parent class of ManagedExecutorServiceImpl / ManagedScheduledExecutorServiceImpl). 
>  - However, these methods are never invoked from EAP 7.x. So, these parameters do not take any effect in EAP 7.x. 
>  - In addition, even if these methods are used, it looks the implementation is totally different from the description in the documentation. The parameter "long-running-tasks" is just used as a flag to skip from checking hung thread detection. And the parameter "hung-task-threshold" never forcefully abort the hung thread exceeding the threshold. 



--
This message was sent by Atlassian Jira
(v7.12.1#712002)



More information about the jboss-jira mailing list