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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
2b0e1ac9
Commit
2b0e1ac9
authored
Mar 29, 2013
by
Tres Seaver
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1 from NextThought/master
ClientStorage.py can deadlock in tpc_begin
parents
4914f272
84aa0c13
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
16 deletions
+19
-16
src/ZEO/ClientStorage.py
src/ZEO/ClientStorage.py
+19
-16
No files found.
src/ZEO/ClientStorage.py
View file @
2b0e1ac9
...
...
@@ -1111,19 +1111,20 @@ class ClientStorage(object):
if
self
.
_is_read_only
:
raise
POSException
.
ReadOnlyError
()
self
.
_tpc_cond
.
acquire
()
self
.
_midtxn_disconnect
=
0
while
self
.
_transaction
is
not
None
:
# It is allowable for a client to call two tpc_begins in a
# row with the same transaction, and the second of these
# must be ignored.
if
self
.
_transaction
==
txn
:
self
.
_tpc_cond
.
release
()
raise
POSException
.
StorageTransactionError
(
"Duplicate tpc_begin calls for same transaction"
)
self
.
_tpc_cond
.
wait
(
30
)
self
.
_transaction
=
txn
self
.
_tpc_cond
.
release
()
try
:
self
.
_midtxn_disconnect
=
0
while
self
.
_transaction
is
not
None
:
# It is allowable for a client to call two tpc_begins in a
# row with the same transaction, and the second of these
# must be ignored.
if
self
.
_transaction
==
txn
:
raise
POSException
.
StorageTransactionError
(
"Duplicate tpc_begin calls for same transaction"
)
self
.
_tpc_cond
.
wait
(
30
)
self
.
_transaction
=
txn
finally
:
self
.
_tpc_cond
.
release
()
try
:
self
.
_server
.
tpc_begin
(
id
(
txn
),
txn
.
user
,
txn
.
description
,
...
...
@@ -1143,9 +1144,11 @@ class ClientStorage(object):
# the right way to set self._transaction to None
# calls notify() on _tpc_cond in case there are waiting threads
self
.
_tpc_cond
.
acquire
()
self
.
_transaction
=
None
self
.
_tpc_cond
.
notify
()
self
.
_tpc_cond
.
release
()
try
:
self
.
_transaction
=
None
self
.
_tpc_cond
.
notify
()
finally
:
self
.
_tpc_cond
.
release
()
def
lastTransaction
(
self
):
return
self
.
_cache
.
getLastTid
()
...
...
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