SA Bugzilla – Bug 8127
Geo::IP leaking fds on spamd restart
Last modified: 2023-08-04 14:57:34 UTC
Copied from Bug 8090 (In reply to Henrik Krohns from comment #10) > (In reply to Paul from comment #9) > > Keeping the DB file open also affects Linux systems using geoip. When a > > reload using SIGHUP is requested a 2nd path is opened without closing the > > original path. This eventually leads to spamd stopping when it5 hits open > > files limit of 1024 > > Please provide proof and exact configuration where this happens? Afaik spamd > starts with a completely new process after HUP, it's not even possible to > have any old open files. spamd configured to have 5 children. root@kanuka:/home/paule# lsof | grep spamd | grep GeoIP.dat | grep root spamd 766010 root 9r REG 8,5 2579835 260907 /usr/share/GeoIP/GeoIP.dat root@kanuka:/home/paule# /etc/init.d/spamassassin reload Reloading spamassassin configuration (via systemctl): spamassassin.service. root@kanuka:/home/paule# lsof | grep spamd | grep GeoIP.dat | grep root spamd 767146 root 9r REG 8,5 2579835 260907 /usr/share/GeoIP/GeoIP.dat spamd 767146 root 11r REG 8,5 2579835 260907 /usr/share/GeoIP/GeoIP.dat root@kanuka:/home/paule# /etc/init.d/spamassassin reload Reloading spamassassin configuration (via systemctl): spamassassin.service. root@kanuka:/home/paule# lsof | grep spamd | grep GeoIP.dat | grep root spamd 767863 root 9r REG 8,5 2579835 260907 /usr/share/GeoIP/GeoIP.dat spamd 767863 root 11r REG 8,5 2579835 260907 /usr/share/GeoIP/GeoIP.dat spamd 767863 root 13r REG 8,5 2579835 260907 /usr/share/GeoIP/GeoIP.dat
This seems to be a bug only in Geo::IP, probably due to it's C-library bindings and stuff. Atleast GeoIP2 or DB_File do not leak. I've committed a quick fix for spamd, but this doesn't fix the problem for amavisd or others that fork SpamAssassin the same way. Sending trunk/spamd/spamd.raw Transmitting file data .done Committing transaction... Committed revision 1909726. Needs some more analyzing whether it can be fixed for amavisd etc without needing to change code there. I'd rather keep the shared GeoDB instead of wasting resources for letting children to load them independently. Or just let it leak for them since there's really no good reason to use Geo::IP anymore.
Thanks that sorts my immediate problem out and has me testing GeoLite2 at last
Postponing to future, nothing to change for 4.0.1 release