Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZEO
Commits
952c0d8f
Commit
952c0d8f
authored
Sep 01, 2000
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added logic to fix race condition involving the commit lock when
the connection to the storage server is disconnected.
parent
0b8b4390
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
src/ZEO/ClientStorage.py
src/ZEO/ClientStorage.py
+8
-2
No files found.
src/ZEO/ClientStorage.py
View file @
952c0d8f
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""Network ZODB storage client
"""
__version__
=
'$Revision: 1.1
3
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
4
$'
[
11
:
-
2
]
import
struct
,
time
,
os
,
socket
,
string
,
Sync
,
zrpc
,
ClientCache
import
tempfile
,
Invalidator
,
ExtensionClass
,
thread
...
...
@@ -105,6 +105,11 @@ class UnrecognizedResult(ClientStorageError):
"""A server call returned an unrecognized result
"""
class
ClientDisconnected
(
ClientStorageError
):
"""The database storage is disconnected from the storage.
"""
class
ClientStorage
(
ExtensionClass
.
Base
,
BaseStorage
.
BaseStorage
):
_connected
=
_async
=
0
...
...
@@ -184,11 +189,11 @@ class ClientStorage(ExtensionClass.Base, BaseStorage.BaseStorage):
def
notifyDisconnected
(
self
,
ignored
):
LOG
(
"ClientStorage"
,
PROBLEM
,
"Disconnected from storage"
)
self
.
_connected
=
0
self
.
_transaction
=
None
thread
.
start_new_thread
(
self
.
_call
.
connect
,(
0
,))
try
:
self
.
_commit_lock_release
()
except
:
pass
def
becomeAsync
(
self
,
map
):
self
.
_lock_acquire
()
try
:
...
...
@@ -401,6 +406,7 @@ class ClientStorage(ExtensionClass.Base, BaseStorage.BaseStorage):
self
.
_lock_release
()
self
.
_commit_lock_acquire
()
self
.
_lock_acquire
()
if
not
self
.
_connected
:
raise
ClientDisconnected
()
try
:
r
=
self
.
_call
(
self
.
__begin
,
id
,
user
,
desc
,
ext
)
except
:
self
.
_commit_lock_release
()
...
...
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