Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
ddfa05a4
Commit
ddfa05a4
authored
Sep 26, 2008
by
Benji York
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a small bug in the file locking error logging
parent
a8ce277c
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 @
ddfa05a4
...
@@ -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:
...
...
src/ZODB/lock_file.py
View file @
ddfa05a4
...
@@ -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
...
...
src/ZODB/lock_file.txt
View file @
ddfa05a4
...
@@ -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()
...
...
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