forked from bblimke/webmock
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
httpclient_adapter uses some standard Ruby hashes, which produce unexpected results when working in a true multi-threaded (e.g. JRuby) environment. Multiple threads doing puts and deletes on these hashes result in nils sometimes being returned for a properly stubbed request. These errors would manifest as: webmock-3.9.2/lib/webmock/http_lib_adapters/httpclient_adapter.rb:113:in `build_httpclient_response': undefined method `body' for nil:NilClass (NoMethodError) Unfortunately these errors are extremly difficult to replicate. This PR is a follow-on from bblimke#908, and represents the last thread-safety issue we've been able to find.
- Loading branch information
Adam Harwood
committed
Oct 16, 2020
1 parent
48cc7c5
commit cf3d1cf
Showing
1 changed file
with
23 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters