streamline local and remote actor profiles.
[Seppo.git] / doc / 00016_--_arch_design.txt
blob23b7d27f3da4a8d72baf8ac23b30a9c4ca7f152a
2 Q: what about qeueuing?
4 A: yes
6 Several operations may finish slowly, so they have to be queued. At the heart
7 there is a wait job queue with one file for each job still due.
9 app/var/spool/jobs/wait/2023-03-13T012345Z.5abf8.12.job
11 The date is the time until which th job is postponed, hash is over the unique job properties, the number is
12 how many tries there have been before. The file content is immutable.
14 Retries double the waiting time each time and timeout after one week. Starting
15 with a 1-minute wait that's 13 tries.
17 Example calculation: Advertise a post to 10k followers - doing 10k sequential
18 jobs each taking 2s is 20ks or 5.5h.
20 The queue health (it should be all empty) is displayed as part of the housekeeping
21 Web UI. File counts, time slots for wait.
23 Queue processing is triggered by
25 - loop until no more job in new
26 - sleeping forks (until next one)
27 - logged in web interaction
28 - endpoint with auth token (monitoring)
30 There should not be more than 1 sleeping fork, however => app/var/lock/job
32 Only jobs entering err log an INFO.
34 Q: How to ensure loss-safe retries? How/where to store retry counter?
35    http://cr.yp.to/proto/maildir.html
36    - in the filename? duplicate jobs possible
37    - in the job? otherwise unchanged payload rewrites and timing issues.
39    API evtl. https://salmon-mail.readthedocs.io/en/latest/_modules/salmon/queue.html