Skip to content

Conversation

aisk
Copy link
Member

@aisk aisk commented May 7, 2024

Related to #232.

I'm not sure if this can totally resolve the original issue, because reproducing a multi-thread bug is hard. I'd like to ship the change because it wouldn't introduce any trouble, and wait to see if there will be more multi-thread issues with the parser. Otherwise, we should introduce a big lock for all these load methods.

@aisk
Copy link
Member Author

aisk commented May 7, 2024

The failed tests are caused by pytest-dev/pytest#12263, as that issue said it will be fixed on tornado or pytest repository, so I'll leave as it is for now.

@aisk aisk merged commit 49fe0ef into Thriftpy:master May 7, 2024
@aisk aisk deleted the parser-thread-safe branch May 7, 2024 07:39
@truebit
Copy link
Contributor

truebit commented May 14, 2024

This change would invoke error AttributeError: '_thread._local' obiect has no attribute 'thrift_stack' when using it with example code:

>>> from thriftpy2.parser. parser import parse
>>> note_thrift = parse("path/ to/ note. thrift")

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