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
92c084c4
Commit
92c084c4
authored
Oct 03, 2003
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure there is a timeout in the synchronous case, too.
Synchronous is what matters for the tests.
parent
1050971d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
trunk/src/ZEO/ClientStorage.py
trunk/src/ZEO/ClientStorage.py
+9
-3
No files found.
trunk/src/ZEO/ClientStorage.py
View file @
92c084c4
...
@@ -319,6 +319,9 @@ class ClientStorage(object):
...
@@ -319,6 +319,9 @@ class ClientStorage(object):
def
_wait
(
self
,
timeout
=
None
):
def
_wait
(
self
,
timeout
=
None
):
if
timeout
is
not
None
:
if
timeout
is
not
None
:
deadline
=
time
.
time
()
+
timeout
deadline
=
time
.
time
()
+
timeout
log2
(
BLATHER
,
"Setting deadline to %f"
%
deadline
)
else
:
deadline
=
None
# Wait for a connection to be established.
# Wait for a connection to be established.
self
.
_rpc_mgr
.
connect
(
sync
=
1
)
self
.
_rpc_mgr
.
connect
(
sync
=
1
)
# When a synchronous connect() call returns, there is
# When a synchronous connect() call returns, there is
...
@@ -336,19 +339,22 @@ class ClientStorage(object):
...
@@ -336,19 +339,22 @@ class ClientStorage(object):
break
break
log2
(
INFO
,
"Waiting for cache verification to finish"
)
log2
(
INFO
,
"Waiting for cache verification to finish"
)
else
:
else
:
self
.
_wait_sync
()
self
.
_wait_sync
(
deadline
)
def
_wait_sync
(
self
):
def
_wait_sync
(
self
,
deadline
=
None
):
# If there is no mainloop running, this code needs
# If there is no mainloop running, this code needs
# to call poll() to cause asyncore to handle events.
# to call poll() to cause asyncore to handle events.
while
1
:
while
1
:
if
self
.
_ready
.
isSet
():
if
self
.
_ready
.
isSet
():
break
break
if
deadline
and
time
.
time
()
>
deadline
:
log2
(
PROBLEM
,
"Timed out waiting for connection"
)
break
log2
(
INFO
,
"Waiting for cache verification to finish"
)
log2
(
INFO
,
"Waiting for cache verification to finish"
)
if
self
.
_connection
is
None
:
if
self
.
_connection
is
None
:
# If the connection was closed while we were
# If the connection was closed while we were
# waiting for it to become ready, start over.
# waiting for it to become ready, start over.
return
self
.
_wait
()
return
self
.
_wait
(
deadline
-
time
.
time
()
)
else
:
else
:
self
.
_connection
.
pending
(
30
)
self
.
_connection
.
pending
(
30
)
...
...
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