Cinder api service outputs error messages when SIGHUP signal is sent

Bug #1337796 reported by Abhishek Kekane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Ankit Agrawal

Bug Description

When SIGHUP signal is send to cinder-api service, it stops all the cinder-api processes and while restarting the cinder-api processes, it throws AttributeError: 'WSGIService' object has no attribute 'reset'.

Steps to reproduce:
1. Run cinder-api service as daemon.
2. Send SIGHUP signal to cinder-api service
   kill -1 <parent_process_id_of_cinder_api>

Tags: ntt
Changed in cinder:
assignee: nobody → Abhishek Kekane (abhishek-kekane)
Revision history for this message
Abhishek Kekane (abhishek-kekane) wrote :

After adding reset method in WSGIService class.

When SIGHUP signal is sent to cinder-api service, it stops all the cinder-api processes and while restarting the cinder-api processes, it throws error: [Errno 9] Bad file descriptor.

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/eventlet/hubs/hub.py", line 346, in fire_timers
    timer()
  File "/usr/lib/python2.7/dist-packages/eventlet/hubs/timer.py", line 56, in __call__cb(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/eventlet/greenthread.py", line 194, in main
    result = function(*args, **kwargs)
  File "/opt/stack/cinder/cinder/openstack/common/service.py", line 483, in run_service
    service.start()
  File "/opt/stack/cinder/cinder/service.py", line 336, in start
    self.server.start()
  File "/opt/stack/cinder/cinder/wsgi.py", line 229, in start
    (self._host, self._port) = self._socket.getsockname()[0:2]
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
  File "/usr/lib/python2.7/socket.py", line 170, in _dummy
    raise error(EBADF, 'Bad file descriptor')
error: [Errno 9] Bad file descriptor

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/106377

Changed in cinder:
assignee: Abhishek Kekane (abhishek-kekane) → Ankit Agrawal (ankitagrawal)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/106377
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=4caca0dfae45dd6c61ddc1b4a2233d2ce1a11685
Submitter: Jenkins
Branch: master

commit 4caca0dfae45dd6c61ddc1b4a2233d2ce1a11685
Author: Ankit Agrawal <email address hidden>
Date: Fri Jul 4 03:41:17 2014 -0700

    Cinder-api service throws error on SIGHUP signal

    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.

    Closes-Bug: #1337796

    Change-Id: Iab32a3fe230a11692a8cad274304214247d6c2c6

Changed in cinder:
status: In Progress → Fix Committed
Changed in cinder:
milestone: none → juno-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: juno-2 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.