Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cse550
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Winston Jodjana
cse550
Commits
5b672a7a
Commit
5b672a7a
authored
2 years ago
by
Dixon Tirtayadi
Browse files
Options
Downloads
Patches
Plain Diff
minor update
parent
f9ef13a2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
assignment2/README.txt
+2
-0
2 additions, 0 deletions
assignment2/README.txt
assignment2/client.py
+1
-5
1 addition, 5 deletions
assignment2/client.py
assignment2/paxos.py
+1
-1
1 addition, 1 deletion
assignment2/paxos.py
with
4 additions
and
6 deletions
assignment2/README.txt
+
2
−
0
View file @
5b672a7a
...
...
@@ -38,6 +38,8 @@ Write-up
kill 1
run 0
run 1
...
exit
Also, for every command done, The LockManager will print the state of locks so you can see what is the state of Locking
and check that it is consistent. For example:
...
...
This diff is collapsed.
Click to expand it.
assignment2/client.py
+
1
−
5
View file @
5b672a7a
...
...
@@ -20,7 +20,7 @@ class LockClient():
self
.
sock
.
bind
((
''
,
0
))
self
.
client_addr
=
self
.
sock
.
getsockname
()
print
(
f
"
Starting client
{
self
.
client_addr
}
"
,
file
=
sys
.
stdout
)
random
.
seed
(
4
)
random
.
seed
(
0
)
# For client timer to know whether to resend message
self
.
req_num
=
0
...
...
@@ -38,10 +38,6 @@ class LockClient():
self
.
sock
.
sendto
(
data
,
server_address
)
setTimer
(
ClientTimer
(
paxos_req
,
self
.
req_num
),
ClientTimer
.
CLIENT_RETRY_MILLIS
,
self
.
onClientTimer
)
# for server_address in server_addresses:
# print(f"Sending command {paxos_req} to {server_address}", file=sys.stdout)
# # send request to server
# sock.sendto(data, server_address)
# receive data back from the server
res
=
pickle
.
loads
(
self
.
sock
.
recv
(
1024
))
...
...
This diff is collapsed.
Click to expand it.
assignment2/paxos.py
+
1
−
1
View file @
5b672a7a
...
...
@@ -142,7 +142,7 @@ class Paxos(socketserver.UDPServer):
self
.
send_msg
(
p2a
,
acceptor
)
self
.
accepted
[
slot
]
=
BallotValuePair
(
BallotNumber
(
self
.
ballot
.
seq_num
,
self
.
address
),
value
.
value
)
self
.
slot
s
_to_acceptors
[
p2a
.
slot_num
].
add
(
self
.
address
)
self
.
slot_to_acceptors
[
p2a
.
slot_num
].
add
(
self
.
address
)
setTimer
(
P2ATimer
(
p2a
),
P2ATimer
.
P2A_RETRY_MILLIS
,
self
.
onP2ATimer
)
...
...
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