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 890842 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]
atomic cache write patch
0001-cache.py-limit-cache-writing-window-limit-chance-of-.patch (text/plain), 1.61 KB, created by
Ales Zelinka
on 2014-04-29 14:40:36 UTC
(
hide
)
Description:
atomic cache write patch
Filename:
MIME Type:
Creator:
Ales Zelinka
Created:
2014-04-29 14:40:36 UTC
Size:
1.61 KB
patch
obsolete
>From 36d246d5f69d90f659bfa54262a548ef4719f4b1 Mon Sep 17 00:00:00 2001 >From: Ales Zelinka <azelinka@redhat.com> >Date: Tue, 29 Apr 2014 16:39:41 +0200 >Subject: [PATCH] cache.py: limit cache writing window, limit chance of cache > corruption > >--- > source/cache.py | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/source/cache.py b/source/cache.py >index 217c9f2..c7572bc 100644 >--- a/source/cache.py >+++ b/source/cache.py >@@ -114,6 +114,7 @@ import gzip > import pickle > import atexit > import datetime >+import tempfile > import xmlrpclib > import nitrate.immutable as immutable > import nitrate.mutable as mutable >@@ -263,11 +264,18 @@ class Cache(object): > > # Dump the cache object into file > try: >- output_file = gzip.open(self._filename, 'wb') >+ # Use temporary file to minimize the time during which >+ # is the real cache inconsistent >+ output_file=tempfile.NamedTemporaryFile(mode='wb', >+ delete=False,prefix="nitrate-cache.", >+ dir=os.path.dirname(self._filename)) >+ log.debug("Temporary cache file {0}".format(output_file.name)) >+ output_file = gzip.open(output_file.name, 'wb') > log.debug("Saving persistent cache into {0}".format( > self._filename)) > pickle.dump(data, output_file) > output_file.close() >+ os.rename(output_file.name,self._filename) > log.debug("Persistent cache successfully saved") > except IOError, error: > log.error("Failed to save persistent cache ({0})".format(error)) >-- >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