benoitc / couchbeam

Apache CouchDB client in Erlang
Other
242 stars 114 forks source link

Fix condition that may cause persistent CLOSE-WAIT sockets #199

Closed cstar closed 4 months ago

cstar commented 4 months ago

By transferring control to couchbeam_view_stream process, we ensure that the socket is effectively closed on both sides, even in case of crashes or stop of this process. In some cases increasing numbers of sockets in CLOSE-WAIT state was observed.

benoitc commented 4 months ago

thanks!

cstar commented 4 months ago

Code to reproduce the issue here: https://friendpaste.com/52BlxIPBaHKVVYl95adzLA