Gracefully killing workers does not release SysV ipc semaphores. The new process opens up a new set, and the system will eventually run out.
SIGINT cleans up correctly
SIGTERM and SIGHUP leave orphaned semaphores
SIGKILL - I'd expect it to leave them
System: OpenBSD 6.1
uwsgi 2.0.14 and 2.0.15
Have been observing the same as well.
uWSGI running with master mode, calling the rc.d(8) script with _reload_ argument sends SIGHUP via _rc_reload_ and results in compounding number of semaphores:
$ ipcs -a |egrep -c nobody
32
$ doas /etc/rc.d/uwsgi_moin_home reload
uwsgi_moin_home(ok)
$ ipcs -a |egrep -c nobody
40
$ doas /etc/rc.d/uwsgi_moin_home reload
uwsgi_moin_home(ok)
$ ipcs -a |egrep -c nobody
48
$ doas /etc/rc.d/uwsgi_moin_home reload
uwsgi_moin_home(ok)
$ ipcs -a |egrep -c nobody
56
Does adding "vacuum = True" to the options, fixes the issue ?
According to the docs, vacuum is for cleaning files/sockets. It changes nothing with respect to this issue (And I had already tried it out for 'just-in-case' ;-)
I have noticed that the ftok option helps. It has to, however, be set per vassal. I've adjusted the config in each vassal to:
pidfile = /path/%n.pid
ftok = /path/%n.pid
I have added this here in case someone else bumps into this issue with SysV Semaphores
Most helpful comment
I have noticed that the ftok option helps. It has to, however, be set per vassal. I've adjusted the config in each vassal to:
pidfile = /path/%n.pid
ftok = /path/%n.pid
I have added this here in case someone else bumps into this issue with SysV Semaphores