logging.SysLogHandler doesn't close UNIX socket when connection failed

Bug #1081022 reported by Ilya Kharin
46
This bug affects 9 people
Affects Status Importance Assigned to Milestone
python2.7 (Ubuntu)
Fix Released
Undecided
Unassigned
Precise
Fix Released
High
Unassigned

Bug Description

[Impact]
Restarting rsyslog causing logging from python based daemons to lockup.

[Test Case]
sudo apt-get install python-eventlet
== run this script script
#!/usr/bin/env python

import eventlet
from logging.handlers import SysLogHandler
import time
import logging

eventlet.patcher.monkey_patch(all=False, socket=True)

logger = logging.getLogger('log')
logger.addHandler(SysLogHandler('/dev/log'))

while True:
    print "send a message to logger"
    logger.error("syslog test")
    time.sleep(1)
==
sudo service rsyslog stop
sudo service rsyslog start
("send a message to logger" log messages will just stop)

[Regression Potential]
The proposed fix is in all py2.7 versions > 12.04 right now and is not causing problems.

[Original Bug Report]
Python logging SysLogHandler to log into SysLog doesn't close UNIX-socket
when connection failed. This bug is solved on the Python Issue Tracker at
http://bugs.python.org/issue15179 and affects python package with version
2.7.3-0ubuntu2 at Ubuntu 12.04 LTS.

Revision history for this message
Ilya Kharin (akscram) wrote :
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python2.7 (Ubuntu):
status: New → Confirmed
Revision history for this message
Matthias Klose (doko) wrote :

fixed in quantal, candidate for a precise SRU

Changed in python2.7 (Ubuntu Precise):
status: New → Confirmed
Changed in python2.7 (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Joe Breu (breu) wrote :

This bug affects several OpenStack projects
https://bugs.launchpad.net/nova/+bug/1101404

Changed in python2.7 (Ubuntu Precise):
status: Confirmed → Fix Committed
status: Fix Committed → Fix Released
Revision history for this message
Marcus Furlong (furlongm) wrote :

The fix for this bug does not seem to have been included in Precise. Was it overlooked?

Revision history for this message
Sam Morrison (sorrison) wrote :

I can confirm the current package doesn't include the patch

Revision history for this message
Karol Szafrański (karol-szafranski) wrote :

As mentioned by Joe Breu, this bug has significant impact on stability of OpenStack services on Precise and the patch is absent on this release.

Revision history for this message
James Page (james-page) wrote :

Looks like this is not actually fixed release - setting back to new.

Changed in python2.7 (Ubuntu Precise):
status: Fix Released → New
importance: Undecided → High
tags: added: mos
James Page (james-page)
description: updated
James Page (james-page)
description: updated
Revision history for this message
James Page (james-page) wrote :

Fix uploaded to precise-proposed for SRU team review.

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Ilya, or anyone else affected,

Accepted python2.7 into precise-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python2.7/2.7.3-0ubuntu3.6 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in python2.7 (Ubuntu Precise):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Liam Young (gnuoy) wrote :

I've reproduced the bug with the instructions from the bug summary on precise using python 2.7.3-0ubuntu3.5 and confirmed the issue is fixed once python was upgraded to 2.7.3-0ubuntu3.6

Liam Young (gnuoy)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python2.7 - 2.7.3-0ubuntu3.6

---------------
python2.7 (2.7.3-0ubuntu3.6) precise-proposed; urgency=medium

  * Ensure failed connections to /dev/log are full closed, preventing
    infinite loop on logging applications due to socket state (LP: #1081022):
    - d/p/syslog.diff: Cherry picked fix from upstream bugtracker.
 -- James Page <email address hidden> Thu, 18 Dec 2014 12:05:28 +0000

Changed in python2.7 (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for python2.7 has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.