151c03d5ec
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
27 lines
629 B
Smarty
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()
|