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

PMap set or __contains__ unreliable in 0.19.1 #263

Closed
mwchase opened this issue Nov 2, 2022 · 2 comments
Closed

PMap set or __contains__ unreliable in 0.19.1 #263

mwchase opened this issue Nov 2, 2022 · 2 comments

Comments

@mwchase
Copy link

mwchase commented Nov 2, 2022

I'm sorry I don't have a better thing to look for here, but the code that hits this is deep in the guts of an application that only I use, and I haven't yet worked out how to extract a reproduction.

Here's what I've got:

I have a frozen attrs class that contains a variety of pyrsistent data structures. Routine tests of the operation of this structure reveal that sometimes, a PMap unexpectedly reports that it does not contain a particular key. Whether it reports this, and which key it reports, varies at random. I believe both string keys, and other attrs classes have been keys that failed.

On 0.19.1 this behavior manifests inconsistently.
On 0.18.1 this behavior does not manifest, so this represents a regression.

Looking over the history of the pmap file, I wonder if 0898ff7 may have broken some invariant.

I believe the maps in question contain no more than a few dozen keys in the cases that hit this.

For now, I can continue developing this application using 0.18.X, but I wanted to make sure this doesn't fall through the cracks. I'll see about getting a minimal reproduction together soon.

@tobgu tobgu closed this as completed in 226ebb6 Nov 3, 2022
namanjain pushed a commit to square/bionic that referenced this issue Nov 3, 2022
Pyrsistent 0.19.1 had a regression in 0.19.1 which was fixed in 0.19.2
The regression was on pmap where inserted elements were unreliably
inserted. See tobgu/pyrsistent#263
@tobgu
Copy link
Owner

tobgu commented Nov 3, 2022

Thanks for reporting this! This was a nasty regression indeed. Fixed in 0.19.2, please verify that it works for you and re-open this issue if you still have problems.

@mwchase
Copy link
Author

mwchase commented Nov 3, 2022

It looks like it's working now, thank you!

I have confirmed that pip freeze output in the relevant virtual environment includes pyrsistent==0.19.2, and one of the tests that was failing somewhere around half the time is now passing every time.

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

No branches or pull requests

2 participants