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
cf6e236f
Commit
cf6e236f
authored
2 years ago
by
Jeffrey Wigger
Browse files
Options
Downloads
Patches
Plain Diff
fixed byes 2
parent
598ddab1
No related branches found
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
+8
-6
8 additions, 6 deletions
src/decentralizepy/communication/TCPRandomWalkRouting.py
with
8 additions
and
6 deletions
src/decentralizepy/communication/TCPRandomWalkRouting.py
+
8
−
6
View file @
cf6e236f
...
...
@@ -796,16 +796,17 @@ class TCPRandomWalkRoutingInternal(TCPRandomWalkBase):
)
self
.
this_round_bye
.
add
(
sender
)
r_was
=
self
.
outgoing_byes
[
sender
]
del
self
.
outgoing_byes
[
sender
]
logging
.
info
(
f
"
added
{
sender
}
to this round
'
s byes
"
)
# raise RuntimeError(
# f"Received a hello from {sender} with {bye[1]} (one behind us)"
# )
if
self
.
outgoing_byes
[
sender
]
!=
bye
[
1
]
+
1
:
if
r_was
!=
bye
[
1
]
+
1
:
# Should not happen as they are connected
print
(
f
"
A bye was received from
{
sender
}
that is behind more than one
{
bye
[
1
]
}
"
)
logging
.
info
(
f
"
A bye was received from
{
sender
}
that is behind more than one
{
bye
[
1
]
}
"
)
print
(
f
"
A bye was received
at
{
r_was
}
from
{
sender
}
that is behind more than one
{
bye
[
1
]
}
"
)
logging
.
info
(
f
"
A bye was received
at
{
r_was
}
from
{
sender
}
that is behind more than one
{
bye
[
1
]
}
"
)
elif
self
.
outgoing_byes
[
sender
]
<
bye
[
1
]:
# We are behind
# We know with certainty that the next round we disconnect (will still send the data)
# final disconnect is handled in delivery
...
...
@@ -815,12 +816,13 @@ class TCPRandomWalkRoutingInternal(TCPRandomWalkBase):
(
sender
,
True
)
)
# TODO: makes sure all entries at bye[1] get deleted in delivery
logging
.
info
(
f
"
added
{
sender
}
to round
{
bye
[
1
]
}
byes
"
)
r_was
=
self
.
outgoing_byes
[
sender
]
del
self
.
outgoing_byes
[
sender
]
# need to remove it else cannot advance
if
self
.
outgoing_byes
[
sender
]
!=
bye
[
1
]
-
1
:
if
r_was
!=
bye
[
1
]
-
1
:
# Should not happen as they are connected
print
(
f
"
A bye was received from
{
sender
}
that is ahead more than one
{
bye
[
1
]
}
"
)
logging
.
info
(
f
"
A bye was received from
{
sender
}
that is ahead more than one
{
bye
[
1
]
}
"
)
print
(
f
"
A bye was received
at
{
r_was
}
from
{
sender
}
that is ahead more than one
{
bye
[
1
]
}
"
)
logging
.
info
(
f
"
A bye was received
at
{
r_was
}
from
{
sender
}
that is ahead more than one
{
bye
[
1
]
}
"
)
else
:
# this goodbye was not initiated by us
logging
.
debug
(
f
"
sender
{
sender
}
not in outgoing byes
"
)
all_to_be_removed
=
self
.
this_round_bye
.
union
(
...
...
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