← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1881297] Re: Neutron agents process name changed after neutron-server setproctitle change

 

Reviewed:  https://review.opendev.org/735125
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=5ce0595803e72157a82f086b520f454786100872
Submitter: Zuul
Branch:    master

commit 5ce0595803e72157a82f086b520f454786100872
Author: Bernard Cafarelli <bcafarel@xxxxxxxxxx>
Date:   Thu Jun 11 14:20:49 2020 +0200

    Set process name for agents
    
    Now that we use setproctitle for neutron-server workers (and
    neutron-keepalived-state-change), this has the side effect of changing
    the process name for agents, impacting some monitoring systems. More
    details in launchpad bug.
    
    This patch fixes it by setting the name with setproctitle to:
    agent name (original process name).
    
    Also use the newly introduced name constants to replace existing
    hardcoded uses.
    
    Change-Id: I74c3a4d3e9f833752571a75f196560cd45529385
    Closes-Bug: #1881297


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1881297

Title:
  Neutron agents process name changed after neutron-server setproctitle
  change

Status in neutron:
  Fix Released

Bug description:
  In bug 1816485 we pushed code [0] to have nice process names for
  neutron-server workers (indicating RPC workers, ...). This was done
  via setproctitle.

  Code itself does not affect other neutron components, but simply
  loading the setproctitle module will affect the process environment
  [1] in /proc/xx/environ.

  This is quite visible when checking "ps -e" output, form:
  # ps -e|grep neutron
   4712 ?        00:00:02 neutron-openvsw
   4775 ?        00:00:00 neutron-rootwra
   4821 ?        00:00:02 neutron-dhcp-ag
   4852 ?        00:00:01 neutron-l3-agen
   4932 ?        00:00:00 neutron-rootwra
   5790 ?        00:00:02 neutron-server
   5844 ?        00:00:00 neutron-server
   5845 ?        00:00:00 neutron-server

  to:
  # ps -e|grep neutron
  28447 ?        00:00:00 neutron-rootwra
  28805 ?        00:00:00 neutron-server:
  28806 ?        00:00:00 neutron-server:
  28807 ?        00:00:00 neutron-server:
  31253 ?        00:00:00 neutron-rootwra

  A shorter test, "ps -e | grep $(pgrep -f neutron-openvswitch-agent)"
  reported neutron-openvswitch-agent in old systems, and now pythonx.x

  Using setproctitle's SPT_NOENV feature to avoid clobbering does not
  work as proper environment name is the full "/usr/bin/python3.6
  /usr/local/bin/neutron-openvswitch-agent --config-file
  /etc/neutron/neutron.conf --config-file
  /etc/neutron/plugins/ml2/ml2_conf.in" (or local equivalent)

  While using other toosl (or ps options) to find the agent process work
  fine, some monitoring solutions only work on env name like "ps -e"
  output

  As we added process names for neutron-keepalived-state-change [2], I
  think the "best of both ways" fix would be to set process names in
  agents starting, with a format like "neutron-openvswitch-agent
  ($original_proc_title)"

  Bonus question: I wonder about backportability of such a fix, as it
  keeps old process name it should be mostly backwards-compatible and
  helps with other use-cases, but it may break for those using exact
  matchin

  [0] https://review.opendev.org/#/c/637019/
  [1] https://pypi.org/project/setproctitle/
  [2] https://review.opendev.org/#/c/660905/

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1881297/+subscriptions


References