Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
Jeffrey_Wigger_Master_Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SaCS
Semester-Projects
spring22
Jeffrey_Wigger_Master_Project
Commits
4a7955a3
Commit
4a7955a3
authored
2 years ago
by
Jeffrey Wigger
Browse files
Options
Downloads
Patches
Plain Diff
refixes tcp routing
parent
c69b3fc6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/decentralizepy/communication/TCPRandomWalkRouting.py
+6
-14
6 additions, 14 deletions
src/decentralizepy/communication/TCPRandomWalkRouting.py
with
6 additions
and
14 deletions
src/decentralizepy/communication/TCPRandomWalkRouting.py
+
6
−
14
View file @
4a7955a3
...
...
@@ -414,7 +414,7 @@ class TCPRandomWalkRoutingInternal(TCPRandomWalkBase):
if
type
(
data
)
==
tuple
and
data
[
0
]
==
HELLO
:
logging
.
debug
(
"
Received {} from {}
"
.
format
(
HELLO
,
src
))
if
src
in
self
.
current_neighbors
:
if
data
[
1
]
!=
"
fw at neighbor
"
:
if
data
[
1
]
!=
"
fw at neighbor
"
:
# TODO: this is wrong
logging
.
critical
(
"
{} wants to connect when already connected!
"
.
format
(
HELLO
,
src
)
)
...
...
@@ -499,8 +499,8 @@ class TCPRandomWalkRoutingInternal(TCPRandomWalkBase):
"
RW message is delivered here due to no new neighbors being available: %s
"
,
str
(
data
[
"
visited
"
]),
)
"
fw
a
t
neighbor
"
self
.
connect
(
new_data
[
"
routing_info
"
])
# TODO: check if not already
a neighbor
#
self.connect(new_data["routing_info"])
return
else
:
logging
.
info
(
...
...
@@ -632,18 +632,10 @@ class TCPRandomWalkRoutingInternal(TCPRandomWalkBase):
)
# True -> we initiated
logging
.
info
(
f
"
Added
{
sender
}
to future neighbors
"
)
del
self
.
outgoing_request
[
sender
]
# cannot advance until this is empty
elif
round
<
self
.
current_round
:
# we are ahead
# TODO: might cause a blocking behaviour, if both start a connection to each other
if
self
.
current_data
!=
None
:
self
.
send
(
sender
,
self
.
current_data
)
# messaging is tcp based --> always arrives after hello
self
.
current_neighbors
.
add
(
sender
)
logging
.
info
(
f
"
Added
{
sender
}
to current neighbors
"
)
del
self
.
outgoing_request
[
sender
]
elif
round
==
self
.
current_round
-
1
:
# we are ahead
# should never arrive, as other round should advance and then send to us with current round
logging
.
info
(
f
"
Received a hello from
{
sender
}
with
{
round
}
"
)
#
raise RuntimeError(f"Received a hello from {sender} with {round}")
logging
.
critical
(
f
"
Received a hello from
{
sender
}
with
{
round
}
"
)
raise
RuntimeError
(
f
"
Received a hello from
{
sender
}
with
{
round
}
"
)
else
:
logging
.
critical
(
f
"
Received a hello from
{
sender
}
with
{
round
}
"
)
raise
RuntimeError
(
f
"
Received a hello from
{
sender
}
with
{
round
}
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment