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

Infinite loop when serializing feature flags #3862

Closed
cmanallen opened this issue Dec 5, 2024 · 2 comments · Fixed by #3861
Closed

Infinite loop when serializing feature flags #3862

cmanallen opened this issue Dec 5, 2024 · 2 comments · Fixed by #3861
Assignees

Comments

@cmanallen
Copy link
Member

How do you use Sentry?

Sentry Saas (sentry.io)

Version

2.18

Steps to Reproduce

from sentry_sdk._lru_cache import LRUCache

cache = LRUCache(3)
cache.set(0, 0)

copied = copy(cache)
copied.set(2, 2)
cache.get_all()  # spins forever

Expected Result

The loop breaks and flags are returned.

Actual Result

Infinite loop.

@cmanallen cmanallen self-assigned this Dec 5, 2024
@cmanallen cmanallen changed the title Infinite loop when getting the flags of the root node after forking. Infinite loop when serializing feature flags Dec 5, 2024
@cmanallen
Copy link
Member Author

cmanallen commented Dec 5, 2024

This is fixed by: #3861

We missed a deepcopy on the LRU. Added a deepcopy and am now using an explicitly terminating loop to prevent this error.

antonpirker pushed a commit that referenced this issue Dec 6, 2024
@aliu39 discovered that under certain circumstances a process can get stuck in an infinite loop.  Andrew fixed this by using `deepcopy` which prevents the infinite loop and fixes a bug where the LRU returns incorrect results.  Additionally, I've added a terminating loop in case there are any future bugs we've missed.

Closes: #3862

Out of precaution, we disabled flagpole evaluation tracking Sentry while we wait for this to be merged.
@antonpirker
Copy link
Member

This has been released with version 2.19.2: https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md#2192

antonpirker added a commit to getsentry/sentry that referenced this issue Dec 6, 2024
Version `2.19.2` of the Sentry Python SDK includes a fix
(getsentry/sentry-python#3862) that is
important for the new feature flag support in Sentry.

---------

Co-authored-by: Burak Yigit Kaya <[email protected]>
mifu67 pushed a commit to getsentry/sentry that referenced this issue Dec 10, 2024
Version `2.19.2` of the Sentry Python SDK includes a fix
(getsentry/sentry-python#3862) that is
important for the new feature flag support in Sentry.

---------

Co-authored-by: Burak Yigit Kaya <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
2 participants