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

use_cassette decorated functions are not reentrant #150

Closed
colonelpanic8 opened this issue Apr 13, 2015 · 1 comment
Closed

use_cassette decorated functions are not reentrant #150

colonelpanic8 opened this issue Apr 13, 2015 · 1 comment

Comments

@colonelpanic8
Copy link
Collaborator

This probably isn't a huge issue, but I just realized that CassetteContextDecorator is not threadsafe. If you were to call a function that is decorated with use_cassette from two different threads, the __finish attribute of the function could be overwritten before the first call to the function returns. This would make it so the first unpatch never occurs, and also attempt to do a next() on a None object.

@colonelpanic8
Copy link
Collaborator Author

I think that this is actually a pretty serious issue. If there is a test runner that does single process threaded test execution, decorated functions could present a problem.

@colonelpanic8 colonelpanic8 changed the title CassetteContextDecorator is not threadsafe use_cassette decorated functions are not reentrant May 10, 2015
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

1 participant