Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

VCR's rack middleware is not threadsafe #58

Closed
myronmarston opened this Issue · 0 comments

1 participant

@myronmarston

VCR as a whole is not threadsafe. It wasn't built with threadsafety in mind as it was meant to be used in a test environment.

This was fine until you start using the provided rack middle ware in a development environment where a browser makes multiple HTTP requests in parallel to your rack app...your server may have multiple threads servicing the requests, and as such, the lack of thread safety causes problems.

The easy solution for now is to put a mutex around VCR.use_cassette in the rack middleware, so multiple threads cannot use VCR simultaneously.

Down the road it might be worthwhile to make VCR threadsafe, but I don't think it's worth the effort right now.

@myronmarston myronmarston closed this issue from a commit
@myronmarston myronmarston Fix rack middleware so that it is threadsafe.
VCR as a whole is not designed to be threadsafe (running your tests in multiple threads is asking for trouble), but the rack middleware needs to be, since some rack servers (like WEBrick) are multithreaded.

Closes #58.
eb530ae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.