[ 
https://issues.apache.org/jira/browse/JAMES-3172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17101373#comment-17101373
 ] 

Benoit Tellier commented on JAMES-3172:
---------------------------------------

IMO it happens when running reactified tasks: cancelation have to be propagated 
in the elatic threads we have been starting.

These tasks calls .block

Looking at `cancel` javadoc : 
https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html


{code:java}
boolean cancel(boolean mayInterruptIfRunning)

Attempts to cancel execution of this task. This attempt will fail if the task 
has already completed, has already been cancelled, or could not be cancelled 
for some other reason. If successful, and this task has not started when cancel 
is called, this task should never run. If the task has already started, then 
the mayInterruptIfRunning parameter determines whether the thread executing 
this task should be interrupted in an attempt to stop the task.
{code}

We might want to interupt the thread running the task.

Another approach could be to completly reactify task execution.

> Cancel a task doesn't seem to really work
> -----------------------------------------
>
>                 Key: JAMES-3172
>                 URL: https://issues.apache.org/jira/browse/JAMES-3172
>             Project: James Server
>          Issue Type: Bug
>            Reporter: René Cordier
>            Priority: Major
>
> Test done with a james-rabbitmq-project docker image (which I believe is 
> using the Distributed Task Manager)
>  
> Launch a task a on provisionned James and try to cancel it, and keep looking 
> at the logs in James...
>  
> For example, I ran the recompute current quota task :
> {code:java}
> curl -XPOST 'http://[JAMES_ADDRESS]/quota/users?task=RecomputeCurrentQuotas'
> {code}
>  
>  Then I cancel it
> {code:java}
> curl -XDELETE 'http://james-charge-01:8000/tasks/[TASK_NUMBER]
> {code}
> By checking the status of the task, I can see that the task has been 
> cancelled... However, if I look at the logs on James at the same time, I 
> could see INFO logs about quotas being still recomputed for users. 
> It looks like to me even if the task got cancelled with the task scheduler, 
> it's still running somehow... Which should not happen



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to