Bug 905286 - Check if stream is closed before unlock()
Summary: Check if stream is closed before unlock()
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-concurrentloghandler
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dan Callaghan
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-29 04:03 UTC by Amit Saha
Modified: 2015-07-26 22:15 UTC (History)
3 users (show)

Fixed In Version: python-concurrentloghandler-0.8.4-10.fc18
Clone Of:
Environment:
Last Closed: 2013-07-10 01:25:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Amit Saha 2013-01-29 04:03:53 UTC
Description of problem:

During release(), unlock() only if the stream hasn't yet been closed. 

Version-Release number of selected component (if applicable):

python-concurrentloghandler-0.8.4-7.fc18.noarch

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Should be fixable via a simple check in ConcurrentRotatingFileHander.release():

if not self.stream.closed:
  unlock(self.stream_lock)

Comment 1 Dan Callaghan 2013-05-16 06:29:57 UTC
Amit, do you have a traceback or any other details about why this is broken and needs to be changed? Under what circumstances is it a problem?

Comment 2 Dan Callaghan 2013-06-19 00:36:48 UTC
Re-open if this is still an issue.

Comment 3 Amit Saha 2013-06-24 04:26:45 UTC
Okay, I could reproduce this issue on F19. If you run beakerd in foreground mode:

# su apache -s /bin/bash -c "/usr/bin/beakerd -f"

and then try to kill it using Ctrl + C, you should be able to see this traceback:

Traceback (most recent call last):
  File "/usr/lib64/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/usr/lib64/python2.7/logging/__init__.py", line 1659, in shutdown
    h.release()
  File "/usr/lib/python2.7/site-packages/cloghandler.py", line 202, in release
    unlock(self.stream_lock)
  File "/usr/lib/python2.7/site-packages/portalocker.py", line 139, in unlock
    fcntl.flock(_getfd(file), fcntl.LOCK_UN)
  File "/usr/lib/python2.7/site-packages/portalocker.py", line 93, in _getfd
    return file.fileno()
ValueError: I/O operation on closed file


If I add a check before attempting to unlock, it doesn't happen any more:

if not self.stream_lock.closed:
     unlock(self.stream_lock)

# rpm -q python-concurrentloghandler
python-concurrentloghandler-0.8.4-9.fc19.noarch

Comment 4 Fedora Update System 2013-06-26 02:35:15 UTC
python-concurrentloghandler-0.8.4-10.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/python-concurrentloghandler-0.8.4-10.fc19

Comment 5 Fedora Update System 2013-06-26 02:35:52 UTC
python-concurrentloghandler-0.8.4-10.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/python-concurrentloghandler-0.8.4-10.fc18

Comment 6 Fedora Update System 2013-06-26 02:36:31 UTC
python-concurrentloghandler-0.8.4-10.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/python-concurrentloghandler-0.8.4-10.fc17

Comment 7 Fedora Update System 2013-06-27 02:08:54 UTC
Package python-concurrentloghandler-0.8.4-10.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python-concurrentloghandler-0.8.4-10.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-11802/python-concurrentloghandler-0.8.4-10.fc18
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2013-07-10 01:25:28 UTC
python-concurrentloghandler-0.8.4-10.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2013-07-10 01:27:22 UTC
python-concurrentloghandler-0.8.4-10.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2013-07-10 01:30:53 UTC
python-concurrentloghandler-0.8.4-10.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.