openstack-helm/neutron/templates/bin/_neutron-netns-cleanup-cron.py.tpl
Thiago Brito 151c03d5ec Fix infinite recursion deadlock on netns cleanup
When, for some reason, the neutron netns agent is misconfigured and is
producing errors, this infinite recursion is generating a deadlock on
cpu usage since it repeats with no interval. This fix adds some shorter
sleeps to work around it.

Signed-off-by: Thiago Brito <thiago.brito@windriver.com>
Change-Id: Icf840ea965d0652d6118a1b840168df95ba95fac
2022-03-10 15:02:11 -03:00

27 lines
629 B
Smarty

#!/usr/bin/env python
import sys
import time
from oslo_config import cfg
from neutron.cmd.netns_cleanup import main
if __name__ == "__main__":
while True:
try:
main()
# Sleep for 12 hours
time.sleep(43200)
except Exception as ex:
sys.stderr.write(
"Cleaning network namespaces caught an exception %s"
% str(ex))
time.sleep(30)
except:
sys.stderr.write(
"Cleaning network namespaces caught an exception")
time.sleep(30)
finally:
cfg.CONF.clear()