Only one PHP script can run at a time. For example, open two tabs. In the first, run the query
SELECT SLEEP(60);
Now attempt to do something in the second tab. Nothing happens until the first query has completed. This is (almost certainly) caused by session locks. PHP maintains a lock on each session (whether file-based session storage or otherwise). This is to prevent two scripts writing to the session store concurrently.
If a script knows that it has finished writing to the $_SESSION superglobal, it can explicitly release the lock. This will allow other scripts to run in parallel.
It is possible that PMA is setting session variables *after* processing (potentially lengthy) SQL operations. If so, it needs to be refactored to set them earlier in the processing.
The fix for this is to add a call to session_write_close() at a suitable point, early in the processing.
In the navigation frame and several other places session_write_close() is already used.
Other useful point could probably be found, so if you have any concrete location where you would want this to happen please feel free to specify or post a patch.
Prevent session locking during lengthy SQL queries.
Try this. It works for me!
Moved to patches.
Greg,
I tried your patch in the QA_3_2 branch (future 3.2.5 version); it applies correctly but does not produce the intended effect.
How do you run the SELECT SLEEP(60) query ?
Oops. Remove the ! from the if statement.
I was playing with debug at the time, so this affected my testing :-(
Merged in subversion, thanks.
Patch reverted, due to https://sourceforge.net/tracker/?func=detail&aid=2973949&group_id=23067&atid=377408
As this patch is causing troubles and there has been no progress in last year, I'm closing this issue. The proper solution will have to re-acquire lock at the end of session to save history and other possible changes.
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).