Skip to content
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

Avoid POSKeyError when commit occurs and we have savepoint that involves Plone Site #4043

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

wesleybl
Copy link
Member

@wesleybl wesleybl commented Nov 4, 2024

When ZODB handles savepoint and we have changes in Plone Site at that savepoint, it changes the _p_estimated_size attribute of Plone Site. This is an assignment to one of the special persistency attributes (identified by an p name prefix); it should happen without access to any other attributes of obj. But obj._tree is accessed in setattr of PloneSite class and results in a ZODB load which apparently fails.

See: plone/plone.restapi#1823 (comment)

Backport of: #4026 to Plone 6.0

@mister-roboto
Copy link

@wesleybl thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@wesleybl wesleybl changed the title Avoid POSKeyError when commit occurs and we have savepoint that involves Avoid POSKeyError when commit occurs and we have savepoint that involves Plone Site Nov 4, 2024
Plone Site

When ZODB handles savepoint and we have changes in Plone Site at that
savepoint, it changes the `_p_estimated_size` attribute of Plone Site.
This is an assignment to one of the special persistency attributes
(identified by an _p_ name prefix); it should happen without access to
any other attributes of obj. But obj._tree is accessed in __setattr__ of
PloneSite class and results in a ZODB load which apparently fails.

See: plone/plone.restapi#1823 (comment)
@wesleybl
Copy link
Member Author

wesleybl commented Nov 4, 2024

@jenkins-plone-org please run jobs

@davisagli davisagli merged commit c2b14e3 into 6.0.x Nov 5, 2024
4 checks passed
@davisagli davisagli deleted the poskeyerror branch November 5, 2024 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants