[BB-4306] Fix Can't upgrade a READER transaction to a WRITER mid-transaction issue
Description
This PR adds a fix for Can't upgrade a READER transaction to a WRITER mid-transaction
issue during integration testing. This issue happens due to random failure thrown by OVH OpenStack API.
The solution provided is to retry on such failures. For example, the error mentioned above throws a 400 bad request error. We can retry all these errors with Retry
provided in the urllib3
package that requests
uses.
But the error mentioned above is thrown from a POST
request and by default Retry
doesn't retry on POST
requests, to avoid multiple insertions. For our use case, we needed to override that by setting method_whitelist
.
Supporting information
Testing instructions
- Check there is no
Can't upgrade a READER transaction to a WRITER mid-transaction
error in integration test
Deadline
ASAP
Other information
Notes
-
method_whitelist
exists in urllib3 v1.25.3 (the version we currently use). But the latest version deprecated it (to be removed in urllib3 v2), instead it has allowed_methods.
Reviewers