-
Notifications
You must be signed in to change notification settings - Fork 28
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
Revise page checkout procedure #756
Comments
In the failure case, the first request to update the page wins and the second request will get an error, correct? |
I suppose the first one to reach the checkout() would think they had the page but the last one would override. The problem would be noticed when they got to the next stage, in the second pass through proof_frame.php when one of them would get an error from resume_saved_page in LPage.php that they didn't have the necessary access. I think the name of this function (and comment in it) is misleading since the page could have come from page_out state. (Unless I have misunderstood how it works) |
One possibility would be to add checks to the WHERE clause of the UPDATE command. E.g., when a page is being checked out, require that it be in the "avail" state. That way, even if We do currently perform these checks, but via a separate query, which is why there's a race condition. We could either retain If the UPDATE fails, you wouldn't necessarily know why (to the level of detail that |
It is theoreticaly possible for two different users to checkout the same page for proofreading if they both access the server at about the same time. The operation is now done in two steps: identify an available page, then update it. If this is running in a pre-emptive multitasking system, another user's request could get between these steps.
There is a case for not doing anything about this since the problem may never happen and would not be serious if it did.
It would be possible to fix it by updating a page based on the selection criteria and then finding it as the newest page checked out to the user.
The text was updated successfully, but these errors were encountered: