[prev in list] [next in list] [prev in thread] [next in thread] 

List:       james-dev
Subject:    [jira] [Created] (JAMES-3890) Allow parallel execution of safe tasks
From:       "Karsten Otto (Jira)" <server-dev () james ! apache ! org>
Date:       2023-02-21 16:52:00
Message-ID: JIRA.13525619.1676998275000.91335.1676998320011 () Atlassian ! JIRA
[Download RAW message or body]

Karsten Otto created JAMES-3890:
-----------------------------------

             Summary: Allow parallel execution of safe tasks
                 Key: JAMES-3890
                 URL: https://issues.apache.org/jira/browse/JAMES-3890
             Project: James Server
          Issue Type: Improvement
          Components: task
    Affects Versions: master
            Reporter: Karsten Otto


Currently, task execution in James is strictly serialized, through a single=
 thread executor and the single active consumer feature of RabbitMQ. Such s=
erial execution prevents tasks from interfering with each others operations=
. The majority of tasks execute in few seconds, so this is fine.

However, some tasks can take considerably longer, from minutes to even hour=
s. In that case, the *long running task will effectively delay execution of=
 any other task* until it is done! I noticed this while experimenting with =
the {{{}ExpireMailboxTask{}}}, throttled down to 1 user/sec for 1000 users;=
 this would delay the periodic {{ReprocessingAllMailsTask}} I use for mail =
re-delivery attempts. This is rather unfortunate, since the two tasks have =
nothing in common to interfere with.

I propose a change to the task system, to allow parallel execution for cert=
ain long running "safe" tasks, in a twofold sense:
 # The task will not likely interfere with the operations of regular tasks.
 # The task gracefully handles issues that can arise from parallel executio=
n. E.g.=C2=A0 when listing mails and later accessing them, some may have be=
en deleted in the meantime.

The aforementioned {{ExpireMailboxTask}} would be a good candidate for this=
, maybe there are others.



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

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic