After adding reset method when SIGHUP signal is sent to
wsgi service parent process,then it sends SIGHUP signal
to all of its child processes. Each child process handles
SIGHUP signal by first stopping the service and then calls
service start method again. When it stops the service, it
kills the eventlet thread, which internally closes the wsgi
server socket object. This server socket object is now not
usable again and it throws following error, while restarting
the service:
error: [Errno 9] Bad file descriptor
To resolve 'Bad file descriptor' error, creating duplicate
socket object, every time service starts.
When the wsgi service is stopped, it sets the green pool
size to 0, so resizing the green pool to default value,
on service restart.
Reviewed: https:/ /review. openstack. org/104887 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=2f3d774eb51 eac9a3708133620 47a2cb3d124d86
Committed: https:/
Submitter: Jenkins
Branch: master
commit 2f3d774eb51eac9 a370813362047a2 cb3d124d86
Author: Rajesh Tailor <email address hidden>
Date: Thu Jul 3 07:44:20 2014 -0700
Nova-api service throws error when SIGHUP is sent
Added reset method in WSGIService class.
After adding reset method when SIGHUP signal is sent to
wsgi service parent process,then it sends SIGHUP signal
to all of its child processes. Each child process handles
SIGHUP signal by first stopping the service and then calls
service start method again. When it stops the service, it
kills the eventlet thread, which internally closes the wsgi
server socket object. This server socket object is now not
usable again and it throws following error, while restarting
the service:
error: [Errno 9] Bad file descriptor
To resolve 'Bad file descriptor' error, creating duplicate
socket object, every time service starts.
When the wsgi service is stopped, it sets the green pool
size to 0, so resizing the green pool to default value,
on service restart.
Closes-Bug: #1334651
Change-Id: If1035deaf8b31f 2712d88f0112fdd 2e9e9dc7cb0