-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Core] Allow parallel handling of requests from same session #7445
Conversation
I think I found write operations on $_SESSION['State'] that occur after session_write_close
|
Thanks.. that looks like dead code, but I think it might actually be why the MRI Violations tests are failing, since MRI Violations hasn't been converted to React yet. Gonna have to think about if there's an easier way to do this than rewriting the module for this PR.. |
I think since MRI violations is the last module in https://github.com/aces/Loris/projects/8 I might as well just do it and then delete that code in this PR. |
8aeb49b
to
0ea24a9
Compare
e7c27ad
to
0ea24a9
Compare
0ea24a9
to
e0c6a75
Compare
e0c6a75
to
d3faed7
Compare
This is cool ! |
This adds a session_write_close() call to the end of NDB_Client, after the last reference to $_SESSION has been made. This causes PHP to release the lock it holds on the session file which prevents further incoming requests from being handled. After this point in NDB_Client all of our session related state should be read from the PSR request, not the superglobal. PHP by default holds a lock on the session until it is closed in case there is a write to the superglobal. However, this prevents other requests from the same session from reading the variable (which is where our login state is stored) until the end of the request, when the lock is released. Closing it explicitly releases the lock and allows us to handle multiple requests from the same user in parallel instead of in series.
d3faed7
to
5660314
Compare
Approving. noticeable difference in request speed. currenlty working on CBIGR biobank |
Note: Talked to @cmadjar before skipping the tests and we agreed to rely on manual testing the mri violations module for now, because of the significant performance implications for other modules (biobank, eeg, etc) |
This adds a session_write_close() call to the end of NDB_Client,
after the last reference to $_SESSION has been made. This causes
PHP to release the lock it holds on the session file which prevents
further incoming requests from being handled. After this point in
NDB_Client all of our session related state should be read from
the PSR request, not the superglobal.
PHP by default holds a lock on the session until it is closed in case
there is a write to the superglobal. However, this prevents other
requests from the same session from reading the variable (which
is where our login state is stored) until the end of the request,
when the lock is released. Closing it explicitly releases the lock
and allows us to handle multiple requests from the same user in parallel
instead of in series.