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

Fix potential recursion/duplicate object detection #54018

Merged
merged 1 commit into from
Jul 26, 2019

Conversation

waynew
Copy link
Contributor

@waynew waynew commented Jul 25, 2019

What does this PR do?

It's unlikely, but possible, that we could get a problem with over-eager
detection of recursion. Especially in the cases of short interned
strings or small numbers on CPython, since those are cached. Instead
we'll just check of it's a type that we're going to recurse on.

What issues does this PR fix or reference?

previous PR #51322
#37646

Previous Behavior

In the extremely unlikely event that we were setting the same object multiple places, or the incredibly unlikely event that we were returning a short string, or the potential case where we were returning two of the same number, it's possible that we could be overeager in our recursion detection.

This stops that.

New Behavior

Only detect recursion on objects that we're going to recurse on.

Tests written?

Yes

Commits signed with GPG?

Yes

@waynew waynew requested a review from a team as a code owner July 25, 2019 22:28
@ghost ghost requested a review from DmitryKuzmenko July 25, 2019 22:28
It's unlikely, but possible, that we could get a problem with over-eager
detection of recursion. Especially in the cases of short interned
strings or small numbers on CPython, since those are cached. Instead
we'll just check of it's a type that we're going to recurse on.
@waynew waynew force-pushed the more-recursive-msgpack-fix branch from ea812c2 to a715b2c Compare July 26, 2019 14:49
@waynew waynew merged commit 90e19da into saltstack:develop Jul 26, 2019
@Ch3LL Ch3LL mentioned this pull request Apr 21, 2020
@Ch3LL Ch3LL added the has master-port port to master has been created label Apr 21, 2020
dwoz added a commit that referenced this pull request Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-jam has master-port port to master has been created
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants