Skip to content

Upload stall timeout detection not accurate #32282

Open
@PVince81

Description

@PVince81

Steps

  1. occ config:app:set files max_chunk_size --value 1024
  2. occ config:app:set files upload_stall_timeout --value 3
  3. Set web server to sleep for one minute randomly during chunk upload, see code below
  4. Upload a 10Kb file (10 chunks)

Code to make server randomly delay, edit "apps/dav/lib/Connector/Sabre/Directory.php" and replace createFileDirectly with the code below:

        public function createFileDirectly($name, $data) {
                $tgt = $this->fileView->fopen($this->getPath() . '/' .  $name, 'wb');

                $count = 0;
                while(!feof($data)) {
                        if (mt_rand(0,99) <= 10) {
                                sleep(60);
                        }
                        $count = fwrite($tgt, fread($data, 512));
                }
                fclose($data);
                fclose($tgt);
        }

Expected result

Stall timeout detected after 3 seconds, then chunk is retried.
Stall timeout must not be tied to progress bar.

Actual result

Stall timeout detected after 1 minute, which is when the server resumes sending data after the sleep() and moves the progress bar.

Versions

OC 10.0.9 + patch from #32170

@pmaier1 FYI

@butonic not sure why you originally decided to tie the stall timeout to the progress bar event. It doesn't seem to work on some environments where the server stalls forever and never sends any bytes, so the progress bar never moves and the stall timeout is never detected or detected very late when the user already gave up.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions