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
49542a20
Commit
49542a20
authored
Mar 18, 2022
by
dieter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix `create_connection` callback
parent
243909ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
src/ZEO/asyncio/client.py
src/ZEO/asyncio/client.py
+7
-7
No files found.
src/ZEO/asyncio/client.py
View file @
49542a20
...
...
@@ -122,15 +122,18 @@ class Protocol(base.Protocol):
cr
=
self
.
loop
.
create_unix_connection
(
self
.
protocol_factory
,
self
.
addr
,
ssl
=
self
.
ssl
)
# an ``asyncio.Future``
self
.
_connecting
=
cr
=
asyncio
.
ensure_future
(
cr
,
loop
=
self
.
loop
)
@
cr
.
add_done_callback
def
done_connecting
(
future
):
if
future
.
exception
()
is
not
None
:
logger
.
info
(
"Connection to %r failed, retrying, %s"
,
self
.
addr
,
future
.
exception
())
try
:
future
.
exception
()
except
Exception
:
logger
.
exception
(
"Connection to %r failed"
,
self
.
addr
)
# keep trying
if
not
self
.
closed
:
logger
.
info
(
"retry connecting %r"
,
self
.
addr
)
self
.
loop
.
call_later
(
self
.
connect_poll
+
local_random
.
random
(),
self
.
connect
,
...
...
@@ -410,10 +413,7 @@ class Client(object):
def
_clear_protocols
(
self
,
protocol
=
None
):
for
p
in
self
.
protocols
:
if
p
is
not
protocol
:
try
:
p
.
close
()
except
asyncio
.
CancelledError
:
continue
p
.
close
()
self
.
protocols
=
()
def
disconnected
(
self
,
protocol
=
None
):
...
...
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