-
Notifications
You must be signed in to change notification settings - Fork 83
Bug when used with multiprocessing #313
Comments
Have you thought about the possibility that there is a CouchDB bug, rather than a bug in CouchDB-Python? In particular, I think observation 4 (thanks for the detailed report!) suggests that the bug might not be in CouchDB-Python. My other thought is that this might have to do with the connection pooling we're doing in One question I have is, when you run this test case for 100 times (or 10), does it fail every time? My expectation would be for it to be intermittent. |
Hi @djc
On couchdb's end, the requests were carried out successfully. I can see in the couchdb logs there are three concurrent GET requests, all responded with
Yes, it fails every single time. I might be able to reduce the sample code even further to only use |
There appears to be a race condition and the bug exists in both Python 2.x and Python 3.x, although they're manifested differently.
Minimum code to reproduce the bug:
Observation 1:
When run on Python 2.x, the following error is encountered:
Observation 2:
When run on Python 3.x, the execution hangs, and when you 'Ctrl+C' to terminate the program, the following stack trace is printed:
Observation 3
If I change the pool size to 1 (essentially serialize the GET operations), the bug does not exist. Same happens when I try to debug it with visual studio code (whose debugger practically blocks the execution of other processes), the code runs without issue.
Observation 4
If I run a proxy server in front of couchdb (e.g., haproxy), the code runs without issue.
The text was updated successfully, but these errors were encountered: