Fix for running out of connections #29

Open
wants to merge 24 commits into
from

Conversation

Projects
None yet
4 participants

Ian1971 commented Apr 26, 2012

This was because when the response was being read the response was not closed at the end. This meant that after 12xnumber cpu cores requests we were out of connections and just got timeouts.

Owner

soitgoes commented Apr 26, 2012

Good catch. The only place it is needed though is in the GetResponsestring. I'll make the change e when I get to work

Ian1971 commented Apr 26, 2012

I see, GetResponseStream closes the connection when the Stream closes.

Contributor

nsainaney commented Aug 7, 2012

The other place I can think of is ViewResult. Perhaps this should implement IDisposable and close the HttpWebResponse there.

Update: Oops. I see you're modifying the Extension class and not the CouchDatabase/ViewResult. If so, I'd recommend an optional argument (e.g. public static Document GetCouchDocument(this HttpWebResponse response, bool closeResponse=true)) so the extension methods don't carry the business logic of closing the connection.

Ian1971 closed this Oct 18, 2013

Ian1971 reopened this Oct 18, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment