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
4e3a243b
Commit
4e3a243b
authored
May 14, 2013
by
Tres Seaver
Browse files
Options
Browse Files
Download
Plain Diff
Merge from master.
parents
4895e57d
b92d880c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
20 deletions
+33
-20
.gitignore
.gitignore
+1
-3
.travis.yml
.travis.yml
+11
-0
src/ZEO/ClientStorage.py
src/ZEO/ClientStorage.py
+21
-17
No files found.
.gitignore
View file @
4e3a243b
*.pyc
*.pyc
__pycache__
__pycache__
src/*.egg-info
*.egg-info
benchmark/*.egg-info
.installed.cfg
.installed.cfg
.tox
.tox
bin
bin
...
...
.travis.yml
0 → 100644
View file @
4e3a243b
language
:
python
python
:
-
2.6
-
2.7
install
:
-
python bootstrap.py
-
bin/buildout
script
:
-
bin/test -v1
notifications
:
email
:
false
src/ZEO/ClientStorage.py
View file @
4e3a243b
...
@@ -1024,7 +1024,8 @@ class ClientStorage(object):
...
@@ -1024,7 +1024,8 @@ class ClientStorage(object):
else
:
else
:
# We're using a server shared cache. If the file isn't
# We're using a server shared cache. If the file isn't
# here, it's not anywhere.
# here, it's not anywhere.
raise
POSException
.
POSKeyError
(
"No blob file"
,
oid
,
serial
)
raise
POSException
.
POSKeyError
(
"No blob file at %s"
%
blob_filename
,
oid
,
serial
)
if
os
.
path
.
exists
(
blob_filename
):
if
os
.
path
.
exists
(
blob_filename
):
return
_accessed
(
blob_filename
)
return
_accessed
(
blob_filename
)
...
@@ -1112,19 +1113,20 @@ class ClientStorage(object):
...
@@ -1112,19 +1113,20 @@ class ClientStorage(object):
if
self
.
_is_read_only
:
if
self
.
_is_read_only
:
raise
POSException
.
ReadOnlyError
()
raise
POSException
.
ReadOnlyError
()
self
.
_tpc_cond
.
acquire
()
self
.
_tpc_cond
.
acquire
()
self
.
_midtxn_disconnect
=
0
try
:
while
self
.
_transaction
is
not
None
:
self
.
_midtxn_disconnect
=
0
# It is allowable for a client to call two tpc_begins in a
while
self
.
_transaction
is
not
None
:
# row with the same transaction, and the second of these
# It is allowable for a client to call two tpc_begins in a
# must be ignored.
# row with the same transaction, and the second of these
if
self
.
_transaction
==
txn
:
# must be ignored.
self
.
_tpc_cond
.
release
()
if
self
.
_transaction
==
txn
:
raise
POSException
.
StorageTransactionError
(
raise
POSException
.
StorageTransactionError
(
"Duplicate tpc_begin calls for same transaction"
)
"Duplicate tpc_begin calls for same transaction"
)
self
.
_tpc_cond
.
wait
(
30
)
self
.
_tpc_cond
.
wait
(
30
)
self
.
_transaction
=
txn
self
.
_transaction
=
txn
self
.
_tpc_cond
.
release
()
finally
:
self
.
_tpc_cond
.
release
()
try
:
try
:
self
.
_server
.
tpc_begin
(
id
(
txn
),
txn
.
user
,
txn
.
description
,
self
.
_server
.
tpc_begin
(
id
(
txn
),
txn
.
user
,
txn
.
description
,
...
@@ -1144,9 +1146,11 @@ class ClientStorage(object):
...
@@ -1144,9 +1146,11 @@ class ClientStorage(object):
# the right way to set self._transaction to None
# the right way to set self._transaction to None
# calls notify() on _tpc_cond in case there are waiting threads
# calls notify() on _tpc_cond in case there are waiting threads
self
.
_tpc_cond
.
acquire
()
self
.
_tpc_cond
.
acquire
()
self
.
_transaction
=
None
try
:
self
.
_tpc_cond
.
notify
()
self
.
_transaction
=
None
self
.
_tpc_cond
.
release
()
self
.
_tpc_cond
.
notify
()
finally
:
self
.
_tpc_cond
.
release
()
def
lastTransaction
(
self
):
def
lastTransaction
(
self
):
return
self
.
_cache
.
getLastTid
()
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