Comment 29 for bug 1276694

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

Reviewed: https://review.openstack.org/161732
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=6d0d72973152bb45587437c80d4ffe0fe7bba761
Submitter: Jenkins
Branch: master

commit 6d0d72973152bb45587437c80d4ffe0fe7bba761
Author: Elena Ezhova <email address hidden>
Date: Tue Apr 7 14:58:13 2015 +0300

    Handle SIGHUP: neutron-server (multiprocess) and metadata agent

    All launchers implemented in common.service require each service to
    implement reset method because it is called in case a process
    receives a SIGHUP.

    This change adds the reset method to neutron.service.RpcWorker and
    neutron.wsgi.WorkerService which are used to wrap rpc and api
    workers correspondingly.

    Now neutron-server running in multiprocess mode (api_workers > 0 and
    rpc_workers > 0) and metadata agent don't die on receiving SIGHUP and support
    reloading policy_path and logging options in config.

    Note that reset is called only in case a service is running in daemon mode.

    Other changes made in the scope of this patch that need to be mentioned:

    * Don't empty self._servers list in RpcWorker's stop method

      When a service is restarted all services are gracefully shutdowned,
      resetted and started again (see openstack.common.service code).
      As graceful shutdown implies calling service.stop() and then
      service.wait() we don't want to clean self._servers list because
      it would be impossible to wait for them to stop processing
      requests and cleaning up their resources.
      Otherwise, this would lead to problems with rpc after starting
      the rpc server again.

    * Create a duplicate socket each time WorkerService starts

      When api worker is stopped it kills the eventlet wsgi server
      which internally closes the wsgi server socket object. This server
      socket object becomes not usable which leads to "Bad file
      descriptor" errors on service restart.

    Added functional and unit tests.

    DocImpact
    Partial-Bug: #1276694
    Change-Id: I75b00946b7cae891c6eb192e853118e7d49e4a24