Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
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
Joanne Hugé
re6stnet
Commits
3ada47f8
Commit
3ada47f8
authored
Feb 13, 2015
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
registry: increase/fix timeouts for requests done by getBootstrapPeer/topology RPC
parent
58204ee8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
re6st/registry.py
re6st/registry.py
+7
-6
No files found.
re6st/registry.py
View file @
3ada47f8
...
@@ -355,10 +355,11 @@ class RegistryServer(object):
...
@@ -355,10 +355,11 @@ class RegistryServer(object):
with
self
.
lock
:
with
self
.
lock
:
address
=
utils
.
ipFromBin
(
self
.
network
+
peer
),
tunnel
.
PORT
address
=
utils
.
ipFromBin
(
self
.
network
+
peer
),
tunnel
.
PORT
self
.
sock
.
sendto
(
'
\
2
'
,
address
)
self
.
sock
.
sendto
(
'
\
2
'
,
address
)
start
=
time
.
time
()
s
=
self
.
sock
,
timeout
=
1
timeout
=
3
end
=
timeout
+
time
.
time
()
# Loop because there may be answers from previous requests.
# Loop because there may be answers from previous requests.
while
select
.
select
(
[
self
.
sock
],
[],
[]
,
timeout
)[
0
]:
while
select
.
select
(
s
,
(),
()
,
timeout
)[
0
]:
msg
=
self
.
sock
.
recv
(
1
<<
16
)
msg
=
self
.
sock
.
recv
(
1
<<
16
)
if
msg
[
0
]
==
'
\
1
'
:
if
msg
[
0
]
==
'
\
1
'
:
try
:
try
:
...
@@ -367,7 +368,7 @@ class RegistryServer(object):
...
@@ -367,7 +368,7 @@ class RegistryServer(object):
continue
continue
if
msg
.
split
()[
0
]
==
peer
:
if
msg
.
split
()[
0
]
==
peer
:
break
break
timeout
=
max
(
0
,
time
.
time
()
-
start
)
timeout
=
max
(
0
,
end
-
time
.
time
()
)
else
:
else
:
logging
.
info
(
"Timeout while querying [%s]:%u"
,
*
address
)
logging
.
info
(
"Timeout while querying [%s]:%u"
,
*
address
)
return
return
...
@@ -419,9 +420,9 @@ class RegistryServer(object):
...
@@ -419,9 +420,9 @@ class RegistryServer(object):
peers
=
deque
((
'%u/%u'
%
(
int
(
self
.
prefix
,
2
),
len
(
self
.
prefix
)),))
peers
=
deque
((
'%u/%u'
%
(
int
(
self
.
prefix
,
2
),
len
(
self
.
prefix
)),))
cookie
=
hex
(
random
.
randint
(
0
,
1
<<
32
))[
2
:]
cookie
=
hex
(
random
.
randint
(
0
,
1
<<
32
))[
2
:]
graph
=
dict
.
fromkeys
(
peers
)
graph
=
dict
.
fromkeys
(
peers
)
s
=
self
.
sock
,
while
True
:
while
True
:
r
,
w
,
_
=
select
.
select
([
self
.
sock
],
r
,
w
,
_
=
select
.
select
(
s
,
s
if
peers
else
(),
(),
3
)
[
self
.
sock
]
if
peers
else
[],
[],
1
)
if
r
:
if
r
:
answer
=
self
.
sock
.
recv
(
1
<<
16
)
answer
=
self
.
sock
.
recv
(
1
<<
16
)
if
answer
[
0
]
==
'
\
xfe
'
:
if
answer
[
0
]
==
'
\
xfe
'
:
...
...
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