-
Notifications
You must be signed in to change notification settings - Fork 113
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
Couchbeam blocks after a while #120
Comments
I don't know if I'm debugging this right, but the problem seems to happen in
|
I replaced
|
ok this bug needs to go to hackney_pool. I tried master too. the |
Hello there, Please correct me if I'm wrong, I just run your test; couchbeam from master (1.1.4), couchDB 1.6.1, Erlang/OTP 17 And Any ideas? Cheers. |
@epappas sure, when doing a single save_doc it'll return {error,not_found} since couchdb returns 404. the problem is after some 150 iterations in quick succession of this call, it seems the hackney_pool stops giving out connections. |
What's interesting is that successful save_docs / PUTs don't have this problem (at least up to some 6000 saves). Just a wild guess that couchdb or hackney behaves differently on 404 responses. Testing… I see that after the 404 responses, there's no http connection in netstat, and couchbeam will use a new connection. With the 201 responses, the http connection is kept alive and successive requests go over the same connection. |
Seems like couchbeam is blocked waiting the attempts to connect to couchdb timeout. Adding the option
Can you confirm? |
Nope, same thing happens. On the 404 errors CouchDB closes the connection, it seems that hackney_pool doesn't handle that so well (but I still don't understand how that works). |
thanks for the feedback. It helped a lot :) |
Couchbeam as of 2dd3426 blocks when I send it this barrage of requests, from the couchdb logs I see 150 requests were made. The database didn't exist so the responses were 404. CouchDB otherwise still works fine (1.6.x).
The example code:
retrying it now when the database does exists.
The text was updated successfully, but these errors were encountered: