•  
      request #47692 Concurrency issues when computing the size headers for /artifact_temporary_files REST endpoints
    Infos
    #47692
    Thomas Gerbet (tgerbet)
    2026-06-19 12:21
    2026-06-19 12:07
    49422
    Details
    Concurrency issues when computing the size headers for /artifact_temporary_files REST endpoints

    When an user is managing multiple uploads at the same time via the /artifact_temporary_files REST endpoints an concurrency issue can occur while computing the "size" headers as file might go missing while doing the computation:

        public function getDiskUsage(PFUser $user): int
        {
            $size = 0;
            foreach (glob($this->getPath($user, '*')) as $file) {
                $size += \Psl\Filesystem\file_size($file);
            }
    
            return $size;
        }
    

    Users should move to the tus endpoints but anyway the code should account for the potential concurrency issue without crashing.

    Trackers
    All
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Thomas Gerbet (tgerbet)
    Under review
    Empty
    Attachments
    Empty
    References
    Referenced by request #47692

    Follow-ups