-
Notifications
You must be signed in to change notification settings - Fork 35
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
Race conditions in tree operations causing Internal Server Errors #1518
Race conditions in tree operations causing Internal Server Errors #1518
Comments
As a first approach we could deactivate the form buttons after they got clicked. That won't really hurt and we can eliminate this possible source for the problem. |
Can you specify that a bit more that we can priorize it in our service team? |
We already released a quick fix so no duplicate versions are created and an internal server error is shown instead. |
However, this is probably the same problem that created the two Landshuts yesterday. As this error always requires some manual cleanup I would prioritize it rather high. |
For reference: This is the corresponding issue in our tree library which could have an impact on this: |
One example traceback during link replacement:
Traceback in page form:
|
As far as I understand there are two things that go wrong:
Is this correct? |
Yes, however converting the library to using the Django ORM is probably unrealistic (even for a large upstream contribution), and I don't know how a custom mutex would be implemented here... maybe the same way as django-linkcheck would suffice? |
True, this would probably solve most issues that do currently arise. There are some edge cases (crashing processes, full hard disk, ...) for which a real transaction would be even better. But these are probably extremely rare in comparison to those race conditions. |
I grepped the logs today. We have only 12 of these messages in 14 days. I think it is okay to remove the "urgent" label. |
Right. I expect we should see at least a decrease in our error rate with the current solution. If that is the case I'd be confident enough in the solution to create an upstream PR that fixes the problem for all queries. |
Quoting from the other issue:
I'm actually not sure anymore, I could also imagine that page moving was never really the problem and most of the race conditions come from normal page form saving (as described above)... |
Another idea from @ulliholtgrave: We could also move the page tree into their separate db tables based on the region, this would also make sure that they're independent and prevent and cross-region-race-conditions... |
django-treebeard/django-treebeard#278 could be relevant to solve this issue. |
Personally, I dislike for the idea of creating tables per region. That happened in WP and always was tedious to work with. |
not closed until confirmed |
Describe the Bug
When content forms are submitted several times in succession too quickly, the same translation version can be created multiple times.
Steps to Reproduce
Send edit requests multiple times after another (for me, it didn't work to push the "save" button multiple times, but I could simulate this beaviour and we know that it already happened in the production system, so somehow this problem definitely exists)
Maybe, this is a combination of autosave and the real saving process?
Expected Behavior
There should only exist exactly one database object for each translation version.
Actual Behavior
In some cases, a version can be created multiple times, which breaks the CMS functionality in multiple places.
The text was updated successfully, but these errors were encountered: