CDN problem

Status
Not open for further replies.

Rodolfo

Chevereto Developer
Chevereto Staff
That concurrency issue shows a conflict in the way your server is configured to sustain the load you are throwing it to it. What I'm trying to say is that you have more concurrent usage than the one that your server can handle. In this case, the problem is that the filesystem speed is too slow for a concurrent process, so you get a race condition where two files can get the same temp name so at some point, one of these concurrent process will fail to deliver.

Try reducing the number of parallel uploads in your Chevereto dashboard. If that doesn't help, you will need to check for any server configuration that could be causing this issue.
 

jiashaowei

Network license
License owner
That concurrency issue shows a conflict in the way your server is configured to sustain the load you are throwing it to it. What I'm trying to say is that you have more concurrent usage than the one that your server can handle. In this case, the problem is that the filesystem speed is too slow for a concurrent process, so you get a race condition where two files can get the same temp name so at some point, one of these concurrent process will fail to deliver.

Try reducing the number of parallel uploads in your Chevereto dashboard. If that doesn't help, you will need to check for any server configuration that could be causing this issue.
After adding CDN and multi-server A record parsing load, errors will be prompted and the target upload is in progress and is aborting.
 

Rodolfo

Chevereto Developer
Chevereto Staff
That's an error message, not an error log. In any case, please follow my previous advice.
 

jiashaowei

Network license
License owner
That's an error message, not an error log. In any case, please follow my previous advice.
When uploading errors, I see the status at the same time. The JSON file shows 400 errors. With the addition of CDN and multi-machine A recording load, this is the case. Everything is normal on a single machine, or you give a friendly solution to multi-machine load.
 

Rodolfo

Chevereto Developer
Chevereto Staff
As you may notice, you are the only person with this issue. Check your server, your problem is there. Do please realize that Chevereto runs on top of your server. If you provide me logs then I can help you, otherwise you are asking me to try to guess what's going on in your machine.

The CDN is just a string that is used in listings and anywhere you retrieve an image. The CDN is not touched at all for the upload process so please stop making the connection between CDN and your error. Your error is because a race condition, if you don't believe me then look for the code for the alleged error:

app/lib/classes/class.upload.php:
        /*
         * Set uploaded_file
         * Local storage uploads will be allocated at the target destination
         * External storage will be allocated to the temp directory
         */
        if ($this->storage_id) {
            $this->uploaded_file = G\forward_slash(dirname($this->downstream)).'/'.Storage::getStorageValidFilename($this->fixed_filename, $this->storage_id, $this->options['filenaming'], $this->destination);
        } else {
            $this->uploaded_file = G\name_unique_file($this->destination, $this->options['filenaming'], $this->fixed_filename);
        }

        $this->source = [
            'filename' => $this->source_filename, // file.ext
            'name' => $this->source_name, // file
            'image_exif' => $this->source_image_exif, // exif-data array
            'fileinfo' => G\get_image_fileinfo($this->downstream), // fileinfo array
        ];

        // Fix image orientation
        if ($this->source_image_exif and $this->source_image_exif['Orientation']) {
            $this->fixImageOrientation($this->downstream, $this->source_image_exif);
        }

        // 666 because concurrency is evil
        if (stream_resolve_include_path($this->downstream) == false) {
            throw new UploadException('Concurrency: Downstream gone, aborting operation', 666);
        }
        if (stream_resolve_include_path($this->uploaded_file) != false) {
            throw new UploadException('Concurrency: Target uploaded file already exists, aborting operation', 666);
        }
In the above, $this->uploaded_file contains the path of the target uploaded file which must be empty otherwise it means that the path is taken by another file. In line 7/9 Chevereto gets a "safe" name but in line 29 Chevereto detects that the file exists.

Hope is clear now, the problem is that you are serving more than what your machine is configured (or capable) to.
 

Support

Member
Chevereto Staff
Unfortunately, this ticket has more than seven days without a reply or feedback from the original poster. We will now consider this ticket abandoned and its now closed.

Don't hesitate to create a new ticket if this matter is still causing you issues.

Ticket closed.
 
Status
Not open for further replies.
Top