Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

something wrong when I run "python server.py A" #1

Open
qidaneix opened this issue Aug 5, 2016 · 1 comment
Open

something wrong when I run "python server.py A" #1

qidaneix opened this issue Aug 5, 2016 · 1 comment

Comments

@qidaneix
Copy link

qidaneix commented Aug 5, 2016

Hi Tom:

How is everything going?

I listened your suggestion and read your code
https://github.com/cocagne/multi-paxos-example

but something wrong when I try to run "python server.py A"
It said

Traceback (most recent call last):
  File "server.py", line 45, in <module>
    m = Messenger(args.uid, config.peers, r)
  File "C:\Users\xiaoj\Documents\multi-paxos-example\messenger.py", line 19, in __init__
    for k,v in self.addrs.items():
RuntimeError: dictionary changed size during iteration

and the line 19 of messenger.py is here:

        # provide two-way mapping between endpoints and server names
        for k,v in self.addrs.items():
            self.addrs[v] = k

I don't understand what's the meaning of those two line, you could help me about that? Thank you!

best wishes!

Jin

@cocagne
Copy link
Owner

cocagne commented Aug 7, 2016

That's a bug. I've just pushed the fix which is to wrap the
"self.addrs.items()" with a call to "list()". Let me know if that doesn't
solve the problem. Also, this code is written for Python 2.7. If you're
trying to run it with Python 3, it almost certainly will not work.

Cheers,

Tom

On Fri, Aug 5, 2016 at 8:12 AM, 肖金 [email protected] wrote:

Hi Tom:

How is everything going?

I listened your suggestion and read your code
https://github.com/cocagne/multi-paxos-example http://url

but something wrong when I try to run "python server.py A"
It said

Traceback (most recent call last):
File "server.py", line 45, in
m = Messenger(args.uid, config.peers, r)
File "C:\Users\xiaoj\Documents\multi-paxos-example\messenger.py", line 19, in init
for k,v in self.addrs.items():
RuntimeError: dictionary changed size during iteration

and the line 19 of messenger.py is here:

    # provide two-way mapping between endpoints and server names
    for k,v in self.addrs.items():
        self.addrs[v] = k

I don't understand what's the meaning of those two line, you could help me
about that? Thank you!

best wishes!

Jin


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1, or mute the
thread
https://github.com/notifications/unsubscribe-auth/ABrLfE5CfVPsE1eEqDDxc6eg0pQoUE6Mks5qczaxgaJpZM4JdquC
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants