Uploaded image for project: 'translate5'
  1. translate5
  2. TRANSLATE-4001

ArchiveTaskActions may be stuck on old tasks and loose data

    XMLWordPrintable

Details

    • Critical
    • ArchiveTaskActions does not archive tasks if there are old tasks in state error and workflowstep filter is used.

    Description

      problems

      bug in workflowStep filter

      workflowStep filter is implemented wrong and is not filtering out tasks in invalid states. 

      The whole feature is implemented with a limit, so that only x tasks are archived per each run. That leads in combination with x tasks in status error and a configured workflowStep filter to the situation that this tasks are not beeing deleted since filtered out in the loop going over the found tasks. So each time the same x tasks are loaded and ignored.

      The SQL should ignore tasks matching by checkStateAllowsActions function.

      probable race condition in worker startup

      In backupThenRemove Method Archive Worker and Export Worker are queued without explicit initial state. So the default state is waiting and that could lead to the situation that the Archive Worker (which then deletes the task) is executed before the normal export worker is called.

      → already done since needed urgently

      invalid json leads to task deletion

      Problem here:

      editor_Workflow_Default_Hooks::decodeParameters and editor_Workflow_Default_AbstractHandler::decodeParameters are logging a Invalid JSON exception but does not break the loop where they are used. That lead to workflow actions calls with default values instead the parameters.

      Solution:

      if there is a an exception the workflow action should not be called. The fact that the workflow action was ignored due another exception should be logged as explicit error.

      security related issue

      if using filesystem local the location parameter must not be used so it must be deleted before usage. Reason:

      1. the source file anyway is an absolute path, so the location is prepended to the source file
      2. Since targetPath can be set to any location, existing files can be overwritten what must be prevented by check existence of target file before

      missing functional test

      A functional test for the editor_Workflow_Actions::deleteOldEndedTasks should be written:

      1. with export (local file system as target, assert needed content there)
      2. just deletetion
      3. assert that the correct tasks according to the filters are deleted (also add x error tasks into the list)

      Attachments

        Activity

          People

            marcmittag Marc Mittag [Administrator]
            tlauria Thomas Lauria
            Thomas Lauria
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: