Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kirill Smelkov
ZEO
Commits
105590ae
Commit
105590ae
authored
16 years ago
by
Benji York
Browse files
Options
Download
Email Patches
Plain Diff
fix a small bug in the file locking error logging
parent
298aefa1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
src/CHANGES.txt
src/CHANGES.txt
+9
-1
src/ZODB/lock_file.py
src/ZODB/lock_file.py
+3
-1
src/ZODB/lock_file.txt
src/ZODB/lock_file.txt
+7
-1
No files found.
src/CHANGES.txt
View file @
105590ae
...
@@ -109,7 +109,15 @@ Bugs Fixed
...
@@ -109,7 +109,15 @@ Bugs Fixed
- Fixed bug in ClientCache that occurred with objects larger than the total
- Fixed bug in ClientCache that occurred with objects larger than the total
cache size.
cache size.
3.8.1b8 (2008-09-??)
3.8.1b9 (2008-??-??)
====================
Bugs Fixed:
- When an error occured attempting to lock a file and logging of said error was
enabled.
3.8.1b8 (2008-09-22
====================
====================
Bugs Fixed:
Bugs Fixed:
...
...
This diff is collapsed.
Click to expand it.
src/ZODB/lock_file.py
View file @
105590ae
...
@@ -82,7 +82,9 @@ class LockFile:
...
@@ -82,7 +82,9 @@ class LockFile:
fp
.
seek
(
1
)
fp
.
seek
(
1
)
pid
=
fp
.
read
().
strip
()[:
20
]
pid
=
fp
.
read
().
strip
()[:
20
]
fp
.
close
()
fp
.
close
()
logger
.
exception
(
"Error locking file"
,
path
,
pid
)
if
not
pid
:
pid
=
'UNKNOWN'
logger
.
exception
(
"Error locking file %s; pid=%s"
,
path
,
pid
)
raise
raise
self
.
_fp
=
fp
self
.
_fp
=
fp
...
...
This diff is collapsed.
Click to expand it.
src/ZODB/lock_file.txt
View file @
105590ae
...
@@ -9,14 +9,20 @@ LockFile object with a file name:
...
@@ -9,14 +9,20 @@ LockFile object with a file name:
>>> import ZODB.lock_file
>>> import ZODB.lock_file
>>> lock = ZODB.lock_file.LockFile('lock')
>>> lock = ZODB.lock_file.LockFile('lock')
If we try to lock the same name, we'll get a lock error:
If we try to lock the same name, we'll get a lock error
and it will be logged
:
>>> import ZODB.tests.loggingsupport
>>> handler = ZODB.tests.loggingsupport.InstalledHandler('ZODB.lock_file')
>>> try:
>>> try:
... ZODB.lock_file.LockFile('lock')
... ZODB.lock_file.LockFile('lock')
... except ZODB.lock_file.LockError:
... except ZODB.lock_file.LockError:
... print "Can't lock file"
... print "Can't lock file"
Can't lock file
Can't lock file
>>> for record in handler.records:
... print record.levelname, record.getMessage()
ERROR Error locking file lock; pid=UNKNOWN
To release the lock, use it's close method:
To release the lock, use it's close method:
>>> lock.close()
>>> lock.close()
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment