Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 890809 Details for
Bug 1091404
Make cache writing and locking more robust
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch for the lock breaking
0001-cache.py-break-lock-when-locking-process-no-longer-r.patch (text/plain), 2.04 KB, created by
Ales Zelinka
on 2014-04-29 14:06:27 UTC
(
hide
)
Description:
patch for the lock breaking
Filename:
MIME Type:
Creator:
Ales Zelinka
Created:
2014-04-29 14:06:27 UTC
Size:
2.04 KB
patch
obsolete
>From 54ec89dfa41032b58ad8aeef0ac4e12ec6f7b9bf Mon Sep 17 00:00:00 2001 >From: Ales Zelinka <azelinka@redhat.com> >Date: Tue, 29 Apr 2014 16:05:28 +0200 >Subject: [PATCH] cache.py: break lock when locking process no longer runs > >--- > source/cache.py | 28 ++++++++++++++++++++++------ > 1 file changed, 22 insertions(+), 6 deletions(-) > >diff --git a/source/cache.py b/source/cache.py >index 60f3da8..217c9f2 100644 >--- a/source/cache.py >+++ b/source/cache.py >@@ -332,16 +332,32 @@ class Cache(object): > # Nothing to do when persistent caching is off > if get_cache_level() < config.CACHE_PERSISTENT: > return >+ # Is cache already locked? >+ locked=True > # Setup the cache > self.setup(filename) >+ if os.path.exists(self._lock): >+ # Check if lock isn't stale >+ try: >+ lock = open(self._lock) >+ lock_pid=lock.readline().strip() >+ lock.close() >+ lock_pid=int(lock_pid) >+ log.cache("Found lock PID {0}".format(lock_pid)) >+ if not os.path.exists("/proc/{0}".format(lock_pid)): >+ log.cache("Breaking stale lock".format(lock_pid)) >+ locked=False >+ except ValueError: >+ log.warn("Malformed cache lock PID: {0}".format(lock_pid)) >+ else: >+ locked=False > # Check for existing cache lock, set mode appropriately >- try: >- lock = open(self._lock) >- log.warn("Found lock {0}, opening read-only".format(self._lock)) >- lock.close() >+ if locked: >+ log.warn("Found active lock {0}, opening read-only".format( >+ self._lock)) > self._mode = "read-only" >- except IOError: >- log.cache("Creating cache lock {0}".format(self._lock)) >+ else: >+ log.cache("Creating new cache lock {0}".format(self._lock)) > lock = open(self._lock, "w") > lock.write("{0}\n".format(os.getpid())) > lock.close() >-- >1.8.3.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1091404
: 890809 |
890842