Feature #2721
open
fix long hangs while there is a pending http request
Added by Anonymous over 10 years ago.
Updated over 10 years ago.
Description
Has anyone else noticed that all open leginon and appion tabs hang while one is busy? This is best seen by starting a particle picking test in appion, and while waiting for the results no other open tab works, not even when switching between images in the viewer. To a lesser degree this means all requests to php scripts that open the session get served serially rather than in parallel.
I think the problem is that PHP sessions are locked, and can only be accessed by one request at a time.
I tested this by explicitly closing the session in the runTemplateCorrelator.php at the very top with the following line:
session_write_close();
this allowed me to keep using the viewer while waiting for the picker to finish.
I don't know how broadly applicable this change is since I'm not sure how often session data is accessed and for what. Ideally you could put this is some central include after all the necessary session parameters have been read.
Does anyone else know better how appion handles sessions?
I'd really like to set it so that the session gets closed as quickly as possible (or opened only when needed). It looks like the session is opened by default whenever processing.inc or project.inc are required, and a lot of things require these modules, but as fas as I can tell, far fewer actually do anything with the session.
I have myamiweb behind a reverse proxy, and it starts to get cranky when a really long request with an opened php session starts to hang all other incoming requests from the same user.
As an example:
I commented out the start_session()
call in project.inc and instead bracketed the only part of the modules that modifies the session:
setsession();
$_SESSION['processingdb']=$db;
$_SESSION['expId']=$expId;
session_write_close();
now the viewer continues to work while there is a job being submitted or tested.
- Priority changed from Normal to High
I think this may be related to the test image in the particle pickers
Also available in: Atom
PDF