SendTimeoutExpiredException does not close the connection

Any exception from Socket.Send() closes the connection:

SendTimeoutExpiredException does not do that.

This leaves the connection in the pool for quite a while. In our case the socket never recovers. Never throws an exception either. So, the connection stays in the pool and keeps causing timeout exceptions.

It’s pretty urgent issue here. Could you suggest any workarounds that I can implement in my code until you fix it?

Hi @mdomashchenko -

Thanks for reporting, this does seem to be a bug; I am surprised this wasn’t identified sooner. I created a ticket NCBC-2200 for tracking, a fix should be in one of the next two releases.

-Jeff

@jmorris, I do understand releases and such, because I have my own and I need a workaround.

Any way I can supply my own socket factory through configuration object?

@mdomashchenko -

It might be easier to simply pull from Gerrit and verify the patch: http://review.couchbase.org/c/118836/

You can configure the SDK to use a custom IConnection implementation or pool, but it’s fairly tricky. I would suggest pulling from above (you’ll need to create an account) and then seeing how well it works. Code in Gerrit is pre-merge into Github so it’s only partially tested.

-Jeff

@jmorris, checked the patch, that’s just one place. There are more variations of Send() in that file and they all seem to have the same bug, including async versions