Handle empty dnsmasq pidfile properly

Bug #865399 reported by Stanislaw Pitucha
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Stanislaw Pitucha
Diablo
Fix Released
Undecided
Unassigned

Bug Description

In some extreme conditions dnsmasq's pidfile can be empty, resulting in an exception when trying to convert the contents into integer. Dnsmasq doesn't try to do an atomic creation+write, so for example XFS has a chance of leaving the file empty after a complete system crash.

Revision history for this message
Stanislaw Pitucha (stanislaw-pitucha) wrote :
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : A change has been merged to openstack/nova

Reviewed: https://review.openstack.org/788
Committed: http://github.com/openstack/nova/commit/a25f106c2f824d7d03bf1161da72f66fe4be5a9c
Submitter: Jenkins
Branch: master

 status fixcommitted
 done

commit a25f106c2f824d7d03bf1161da72f66fe4be5a9c
Author: Yun Shen <email address hidden>
Date: Thu Sep 29 12:09:37 2011 +0100

    Handle pidfile exception for dnsmasq

    Capture the exception in dnsmasq_pid_for method. If the pidfile cannot be read
    for some reason, it should be treated as if it does not exist. This prevents
    issues where the filesystem write delay leaves the file created but empty.
    Fixes bug 865399.

    Change-Id: I3b0f1211762696f925ae32d785ffa6a35c5e1d6b

Changed in nova:
status: New → Fix Committed
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to nova (stable/diablo)

Reviewed: https://review.openstack.org/1082
Committed: http://github.com/openstack/nova/commit/ad4eef0a0b296652f8ce08d86a10dea8a40b005b
Submitter: Jenkins
Branch: stable/diablo

 status fixcommitted
 done

commit ad4eef0a0b296652f8ce08d86a10dea8a40b005b
Author: Yun Shen <email address hidden>
Date: Thu Sep 29 12:09:37 2011 +0100

    Handle pidfile exception for dnsmasq

    Capture the exception in dnsmasq_pid_for method. If the pidfile cannot be read
    for some reason, it should be treated as if it does not exist. This prevents
    issues where the filesystem write delay leaves the file created but empty.
    Fixes bug 865399.

    (cherry picked from commit a25f106c2f824d7d03bf1161da72f66fe4be5a9c)

    Change-Id: Ifd79c7143060702bfe359f0e0a35867c685e27df

Thierry Carrez (ttx)
Changed in nova:
milestone: none → essex-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Stanislaw, or anyone else affected,

Accepted nova into oneiric-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Revision history for this message
Adam Gandelman (gandelman-a) wrote :

Verified the package nova-network 2011.3+git20111117-0ubuntu1 in oneiric-proposed resolves this issue without regression.

As a test case, I've run one instance, killed the dnsmasq process that nova-network creates, create an empty pid file in place of the original dnsmasq pid file, and run another instance on the same host. The dnsmasq process and successfully restarted without exceptions. Log available: http://paste.ubuntu.com/775578/

The same test case prior to this fix results in the following traceback in nova-network.log - http://paste.ubuntu.com/775581/

Martin Pitt (pitti)
tags: added: verification-done
removed: verification-needed
Mark McLoughlin (markmc)
Changed in nova:
assignee: nobody → Stanislaw Pitucha (stanislaw-pitucha)
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-1 → 2012.1
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.