Skip to content

Handle replication lag on process creation

https://redmine.teklia.com/issues/10676

When an Arkindex EE instance with a replica is under heavy load, some HTTP 404 errors can occur when creating inference, training, import, or export processes. The existing corpus awaiter view at /corpus/:id/wait should be made more generic to allow waiting for both a corpus or a process to be created, then redirect to the correct page depending on the details of the new process:

  • If a process has any tasks, it means it was created and immediately started (import/export processes), so the process status page should be shown.
  • For Workers processes that have not yet been started, redirect to the process elements filtering page.
  • For Dataset processes that have not yet been started, redirect to the process dataset sets selection page.
  • For other processes, redirect to the process status page anyway, because we shouldn't have any import or export process that did not start, and the only mode left is for templates, which are also displayed by that same page.

All frontend actions that create a process, then redirect to the process elements/datasets/status pages, should redirect to the awaiter instead, but only in Arkindex EE. None of this is necessary in Arkindex CE since replication is not supported there.