pagekite / libpagekite

A high performance PageKite implementation in C
https://pagekite.net/wiki/Floss/LibPageKite/
86 stars 38 forks source link

libpagekite leaks file descriptors #31

Closed guillerodriguez closed 7 years ago

guillerodriguez commented 7 years ago

In scenarios with poor Internet connectivity, libpagekite seems to be leaking file descriptors. Eventually this leads to exhaustion of available fds for the process that is using libpagekite.

This can be reproduced by using dummynet / ipfw to simulate poor network connectivity conditions. For example the following commands will limit network bandwidth to 1Mbit/s and introduce a packet loss rate of 16%:

ipfw pipe 1 config bw 1Mbit/s plr 0.16
ipfw add 1000 pipe 1 ip from any to any

With this configuration, and monitoring with lsof, I see a steadily increasing number of TCP connections stalled in the CLOSE_WAIT state.

BjarniRunar commented 7 years ago

Thanks again for your work on this!