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

Explicitly invalidate the global parse hash in SpecParser constructor #409

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

nforro
Copy link
Member

@nforro nforro commented Sep 4, 2024

Python can reuse id of objects after they are garbage-collected, however the global parse hash contains an id of SpecParser instance in order to force parsing on context switches, and when a different instance has the same id, it has no way to detect that.

Explicitly invalidate the global parse hash when a SpecParser instance is created to prevent this issue.

Fixes packit/packit-service#2461.

Python can reuse id of objects after they are garbage-collected, however
the global parse hash contains an id of `SpecParser` instance in order
to force parsing on context switches, and when a different instance has
the same id, it has no way to detect that.

Explicitly invalidate the global parse hash when a `SpecParser` instance
is created to prevent this issue.

Signed-off-by: Nikola Forró <[email protected]>
Copy link
Contributor

Build succeeded.
https://softwarefactory-project.io/zuul/t/packit-service/buildset/32d91680791549838afc40829072dd38

✔️ pre-commit SUCCESS in 2m 11s
✔️ specfile-tests-rpm-deps SUCCESS in 1m 13s
✔️ specfile-tests-pip-deps SUCCESS in 1m 15s

Copy link
Member

@lbarcziova lbarcziova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting, good catch!

@nforro nforro added the mergeit Zuul, merge it! label Sep 5, 2024
Copy link
Contributor

Build succeeded (gate pipeline).
https://softwarefactory-project.io/zuul/t/packit-service/buildset/c24ec86241174eb8b013e41ecc6e68a8

✔️ pre-commit SUCCESS in 2m 09s

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 25735a9 into main Sep 5, 2024
34 checks passed
@nforro nforro deleted the parsing branch September 5, 2024 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mergeit Zuul, merge it!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AttributeError: 'NoneType' object has no attribute 'sourceHeader'
2 participants