LycheeOrg / Lychee-v3

A great looking and easy-to-use photo-management-system you can run on your server, to manage and share photos.

Home Page:https://lycheeorg.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP Session is blocked while upload is in progress "error 504 gateway time-out"

RafalGoslawski opened this issue · comments

Detailed description of the problem

When importing a lot of data from the server, the uploading user session is blocking other requests in the same browser (different tab). Requests to index.php result in error 504 gateway time-out. This prevents the user from working on the albums from the same browser for a long time. It is possible to run requests from another browser, in incognito mode, or after clearing the session cookie. This leads me to believe it is caused by the lock on the PHP session file. A possible solution is to call session_write_close() as soon as no more data is written or read from the session file. Example: https://codingexplained.com/coding/php/solving-concurrent-request-blocking-in-php

Steps to reproduce the issue

  1. Start a big import from the server.
  2. Open lychee in a second tab -> 504 gateway timeout error until the import finishes

Output of the diagnostics (Settings => Diagnostics)

Diagnostics
-----------
Warning: Dropbox import not working. No property for dropboxKey.
No critical problems found. Lychee should work without problems!


System Information
------------------
Lychee Version (json):  3.2.16
Lychee Version (git):   No git data found. Probably installed from release.
DB Version:             update_030216
System:                 Linux
PHP Version:            7.3
MySQL Version:          50505
Imagick:                1
Imagick Active:         1
Imagick Version:        1800
GD Version:             bundled (2.1.0 compatible)
Plugins:                


Config Information
------------------
checkForUpdates:         1
default_license:         reserved
deleteImported:          1
full_photo:              1
hide_version_number:     1
image_overlay:           0
image_overlay_type:      exif
imagick:                 1
lang:                    en
layout:                  0
medium_max_height:       1080
medium_max_width:        1920
php_script_limit:        1
public_search:           0
skipDuplicates:          0
small_max_height:        360
small_max_width:         0
sortingAlbums:           ORDER BY id DESC
sortingPhotos:           ORDER BY id DESC
useExiftool:             0
version:                 update_030216

Browser and system

Server: Debian 9
Client: Ubuntu 18.04, tested with latest firefox and chrome

This issue is fixed in Lychee-Laravel (to be v4), which has a rewritten server. See here: https://github.com/LycheeOrg/Lychee-Laravel/