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

Benoit Tellier commented on JAMES-4042:
---------------------------------------

> The main issue with an AsyncSafeTask is that it needs to be reasonably "safe" 
> (hence the name) to execute in parallel with other tasks, or even with 
> multiple instances of itself.

This is the entire point why this was implemented as mutually exclusive.

To be fair I have yet to be provided an example of two tasks that cannot be run 
together. 

We tend to design tasks so that they can be run "live" so that they are 
reasonably transparent. EG appart from performance degradation the GC has no 
other side effects, so do the reindexing, and so do the Cassandra consistency 
checks, and so do the quota recomputation, etc...

The only benefit of the current exclusive task execution behaviour I see is to 
act as a primitive scheduler.

> Task manager: issues with long tasks
> ------------------------------------
>
>                 Key: JAMES-4042
>                 URL: https://issues.apache.org/jira/browse/JAMES-4042
>             Project: James Server
>          Issue Type: Improvement
>          Components: rabbitmq, task
>    Affects Versions: master, 3.8.2
>            Reporter: Benoit Tellier
>            Priority: Major
>
> See JAMES-3955
> Today a tasks per default obey a 1 day consumer timeout (configurable!)
> Yet, we might have some tasks like deduplication that might take longer than 
> a day to complete...
> As of today tihis means such a task would complete but very likely crash the 
> consumer.
> Likely, getting such long jobs in the first place might not be the best idea.
> Things like deduplication could be packaged in separate binaries that one 
> could run independently of James thus avoiding the issue altogether... We 
> could allow this as an alternative way to run such long tasks.
> Moreover, I think if needed we could write a Proof Of Concept of running the 
> GC on top of something like Apache Spark to leverage parallele computations.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to