SIGHUP's effect on parameters is not well defined

Bug #1364468 reported by Stuart McLaren
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Confirmed
Undecided
Unassigned

Bug Description

If I start the api server using:

 $ cd /opt/stack/cinder && /usr/local/bin/cinder-api --config-file /etc/cinder/cinder.conf &

and, using a debug statement, print out the value of the 'glance_core_properties' parameter:

 +++ b/cinder/volume/api.py
 @@ -330,6 +330,8 @@ class API(base.Base):

         if filters:
             LOG.debug("Searching by: %s" % str(filters))
+ LOG.debug("CONF %s" % str(CONF.glance_core_properties))

then do a 'cinder list' to trigger the debug I see the default values for this parameter:

 5f00a82aa4004bfd90c0f02a8d118d96 2dcea26aa97a41fa9547a133f6c7f5b4] CONF ['checksum', 'container_format', 'disk_format', 'image_name', 'image_id', 'min_disk', 'min_ram', 'name', 'size'] from (pid=24052) get_all /opt/stack/cinder/cinder/volume/api.py:334

If I then edit /etc/cinder/cinder.conf to add a custom definition of 'glance_core_properties' (adding 'blah' on the end):

 glance_core_properties = checksum,container_format,disk_format,image_name,image_id,min_disk,min_ram,name,size,blah

and finally do a SIGHUP on the parent cinder api process:

 cinder$ ps auwx |grep cinder-api |grep -v grep
 ubuntu 24044 0.6 0.3 215004 61040 pts/23 S 15:08 0:07 /usr/bin/python /usr/local/bin/cinder-api --config-file /etc/cinder/cinder.conf
 ubuntu 24052 0.0 0.4 305112 65736 pts/23 S 15:08 0:00 /usr/bin/python /usr/local/bin/cinder-api --config-file /etc/cinder/cinder.conf

cinder$ kill -HUP 24044

(and check the same process ids exist as before):

 cinder$ ps auwx |grep cinder-api |grep -v grep
ubuntu 24044 0.6 0.3 215004 61040 pts/23 S 15:08 0:07 /usr/bin/python /usr/local/bin/cinder-api --config-file /etc/cinder/cinder.conf
 ubuntu 24052 0.0 0.4 305112 65736 pts/23 S 15:08 0:00 /usr/bin/python /usr/local/bin/cinder-api --config-file /etc/cinder/cinder.conf

what I find is that the new value of the glance_core_properties parameter is in effect, ie the debug shows:

 2014-09-02 15:10:34.561 DEBUG cinder.volume.api [req-0c29fa25-cd9a-442e-ae61-3b74275e7291 5f00a82aa4004bfd90c0f02a8d118d96 2dcea26aa97a41fa9547a133f6c7f5b4] CONF ['checksum', 'container_format', 'disk_format', 'image_name', 'image_id', 'min_disk', 'min_ram', 'name', 'size', 'blah'] from (pid=24052) get_all /opt/stack/cinder/cinder/volume/api.py:334

but ... the entries in /etc/cinder/cinder.conf are not treated consistently.

For example, if osapi_volume_listen_port is changed and a SIGHUP is sent, the port the service is listening on is not changed. Similarly, a change to osapi_volume_workers doesn't change the number of workers.

Changes to any parameters which are configured at start up of the service (including debug = True/False) do not get picked up after a SIGHUP. The impact of a change to some parameters (eg 'lock_path') is not clear. The only way for an operator to figure out which parameters will be updated after a SIGHUP is by looking through the code, or trial and error. If a SIGHUP does pick up a change to a parameter an operator still can't be sure that it's safe to make that change or not (eg 'lock_path').

summary: - SIGHUP effect on parameters not well defined
+ SIGHUP's effect on parameters is not well defined
Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :

Also related, (but possibly a separate bug) if I do

$ nc localhost 8776

prior to the SIGHUP

then no requests sent after the SIGHUP are processed until that (unauthenticated) client connection is killed.

Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :

Some notes on possible ways to handle sighup better:
https://etherpad.openstack.org/p/sighup-conf-reload

Ivan Kolodyazhny (e0ne)
Changed in cinder:
status: New → Confirmed
assignee: nobody → Ivan Kolodyazhny (e0ne)
Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :

FWIW this is what Glance did to address some of these issues (based on new eventlet functionality):

 https://review.openstack.org/#/c/122181/

Revision history for this message
Sean McGinnis (sean-mcginnis) wrote :

Automatically unassigning due to inactivity.

Changed in cinder:
assignee: Ivan Kolodyazhny (e0ne) → nobody
Michael Dovgal (mdovgal)
Changed in cinder:
assignee: nobody → Michael Dovgal (mdovgal)
Revision history for this message
Sean McGinnis (sean-mcginnis) wrote : Bug Assignee Expired

Unassigning due to no activity for > 6 months.

Changed in cinder:
assignee: Michael Dovgal (mdovgal) → nobody
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.