rootwrap daemon doesn't close parent's file descriptors after forking

Bug #1658973 reported by Ralf Haferkamp
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.rootwrap
Fix Released
Undecided
Ralf Haferkamp

Bug Description

When using the rootwrap daemon with neutron-openvswitch-agent, there is a "/usr/bin/neutron-rootwrap-daemon" which is listening on port 6633:

# ss -ptl | grep 6633
LISTEN 0 50 127.0.0.1:6633 *:* users:(("sudo",pid=11451,fd=3),("neutron-openvsw",pid=11430,fd=3))

That port is supposed to belong to neutron-openvswitch-agent for communicating with ovs-vswitchd. The rootwrap daemon "inherits" this port, because it doesn't close its filedescriptors (apart from stdin/out/err) after forking.

Ralf Haferkamp (rhafer)
Changed in oslo.rootwrap:
assignee: nobody → Ralf Haferkamp (rhafer)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.rootwrap (master)

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

Changed in oslo.rootwrap:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.rootwrap (master)

Reviewed: https://review.openstack.org/425069
Committed: https://git.openstack.org/cgit/openstack/oslo.rootwrap/commit/?id=458d79b61abb1a9ad36ce4868cf248ddb21c80a7
Submitter: Jenkins
Branch: master

commit 458d79b61abb1a9ad36ce4868cf248ddb21c80a7
Author: Ralf Haferkamp <email address hidden>
Date: Tue Jan 24 12:08:46 2017 +0100

    [daemon] Close inherited filedescriptors after forking

    We don't want to keep listening on the parent's sockets (e.g. when
    started by neutron-openvswitch agent) after forking the rootwrap
    daemon.

    Closes-Bug: #1658973
    Change-Id: I3e364e9d3ad4e2fcd6f4d8f52f847ec9fa944572

Changed in oslo.rootwrap:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.rootwrap (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/425607

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.rootwrap (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/435134

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.rootwrap (stable/ocata)

Reviewed: https://review.openstack.org/435134
Committed: https://git.openstack.org/cgit/openstack/oslo.rootwrap/commit/?id=f080dffdfd6b91b4fe99029fbd7a867b6e1141cf
Submitter: Jenkins
Branch: stable/ocata

commit f080dffdfd6b91b4fe99029fbd7a867b6e1141cf
Author: Ralf Haferkamp <email address hidden>
Date: Tue Jan 24 12:08:46 2017 +0100

    [daemon] Close inherited filedescriptors after forking

    We don't want to keep listening on the parent's sockets (e.g. when
    started by neutron-openvswitch agent) after forking the rootwrap
    daemon.

    Closes-Bug: #1658973
    Change-Id: I3e364e9d3ad4e2fcd6f4d8f52f847ec9fa944572
    (cherry picked from commit 458d79b61abb1a9ad36ce4868cf248ddb21c80a7)

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.rootwrap (stable/newton)

Reviewed: https://review.openstack.org/425607
Committed: https://git.openstack.org/cgit/openstack/oslo.rootwrap/commit/?id=f8fbd3efe409e2722ba94d749350d23d6aabff48
Submitter: Jenkins
Branch: stable/newton

commit f8fbd3efe409e2722ba94d749350d23d6aabff48
Author: Ralf Haferkamp <email address hidden>
Date: Tue Jan 24 12:08:46 2017 +0100

    [daemon] Close inherited filedescriptors after forking

    We don't want to keep listening on the parent's sockets (e.g. when
    started by neutron-openvswitch agent) after forking the rootwrap
    daemon.

    Closes-Bug: #1658973
    Change-Id: I3e364e9d3ad4e2fcd6f4d8f52f847ec9fa944572
    (cherry picked from commit 458d79b61abb1a9ad36ce4868cf248ddb21c80a7)

tags: added: in-stable-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to oslo.rootwrap (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/438816

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.rootwrap 5.5.0

This issue was fixed in the openstack/oslo.rootwrap 5.5.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to oslo.rootwrap (master)

Reviewed: https://review.openstack.org/438816
Committed: https://git.openstack.org/cgit/openstack/oslo.rootwrap/commit/?id=6285b63572c893391cb1a9e0c482658938f13329
Submitter: Jenkins
Branch: master

commit 6285b63572c893391cb1a9e0c482658938f13329
Author: IWAMOTO Toshihiro <email address hidden>
Date: Tue Feb 28 15:12:01 2017 +0900

    Allow rootwrap-daemon to timeout and exit

    If the client side abnormally exits, its rootwrap daemon cannot
    receive a shutdown message and will be left forever. Let it timeout
    and exit to save such cases.

    Change-Id: I783717b5fa019371747b98bf92965b6e689603f6
    Related-bug: #1658973
    Related-bug: #1658977
    Related-bug: #1663458

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to oslo.rootwrap (stable/ocata)

Related fix proposed to branch: stable/ocata
Review: https://review.openstack.org/448744

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to oslo.rootwrap (stable/newton)

Related fix proposed to branch: stable/newton
Review: https://review.openstack.org/448745

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to oslo.rootwrap (stable/ocata)

Reviewed: https://review.openstack.org/448744
Committed: https://git.openstack.org/cgit/openstack/oslo.rootwrap/commit/?id=fdacd0e60817db8455b3c2f21b60e8a2130953aa
Submitter: Jenkins
Branch: stable/ocata

commit fdacd0e60817db8455b3c2f21b60e8a2130953aa
Author: IWAMOTO Toshihiro <email address hidden>
Date: Tue Feb 28 15:12:01 2017 +0900

    Allow rootwrap-daemon to timeout and exit

    If the client side abnormally exits, its rootwrap daemon cannot
    receive a shutdown message and will be left forever. Let it timeout
    and exit to save such cases.

    Change-Id: I783717b5fa019371747b98bf92965b6e689603f6
    Related-bug: #1658973
    Related-bug: #1658977
    Related-bug: #1663458
    (cherry picked from commit 6285b63572c893391cb1a9e0c482658938f13329)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to oslo.rootwrap (stable/newton)

Reviewed: https://review.openstack.org/448745
Committed: https://git.openstack.org/cgit/openstack/oslo.rootwrap/commit/?id=af8ad2da809f68442da9aacd17a47bca342eb355
Submitter: Jenkins
Branch: stable/newton

commit af8ad2da809f68442da9aacd17a47bca342eb355
Author: IWAMOTO Toshihiro <email address hidden>
Date: Tue Feb 28 15:12:01 2017 +0900

    Allow rootwrap-daemon to timeout and exit

    If the client side abnormally exits, its rootwrap daemon cannot
    receive a shutdown message and will be left forever. Let it timeout
    and exit to save such cases.

    Change-Id: I783717b5fa019371747b98bf92965b6e689603f6
    Related-bug: #1658973
    Related-bug: #1658977
    Related-bug: #1663458
    (cherry picked from commit 6285b63572c893391cb1a9e0c482658938f13329)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.rootwrap 5.1.2

This issue was fixed in the openstack/oslo.rootwrap 5.1.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.rootwrap 5.4.1

This issue was fixed in the openstack/oslo.rootwrap 5.4.1 release.

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.