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 try to propose a value from client #2

Open
qidaneix opened this issue Nov 2, 2016 · 2 comments
Open

something wrong when I try to propose a value from client #2

qidaneix opened this issue Nov 2, 2016 · 2 comments

Comments

@qidaneix
Copy link

qidaneix commented Nov 2, 2016

Tom,

Hi!

I have configed multi-paxos-example in my computer windows7 64bit.

# (IP,UDP Port Number)
peers = dict( A=('127.0.0.1',1234),
              B=('127.0.0.1',1235),
              C=('127.0.0.1',1236) )

# State files for crash recovery. Windows users will need to modify
# these.
state_files = dict( A='E:\\multi-paxos-example\\tmp\\A.json',
                    B='E:\\multi-paxos-example\\tmp\\B.json',
                    C='E:\\multi-paxos-example\\tmp\\C.json' )

And try to run it. But when I run a client
python client.py B eee
It comes up a Error.

Error processing packet:  accept {"instance_number": 0, "proposal_id": [1, "B"],
 "proposal_value": "eee"}
Traceback (most recent call last):
  File "E:\multi-paxos-example\messenger.py", line 55, in datagramReceived
    handler(from_uid, **kwargs)
  File "E:\multi-paxos-example\resolution_strategy.py", line 82, in receive_acce
pt
    super(ExponentialBackoffResolutionStrategyMixin,self).receive_accept(from_ui
d, instance_number, proposal_id, proposal_value)
  File "E:\multi-paxos-example\replicated_value.py", line 176, in receive_accept

    proposal_id, proposal_value)
  File "E:\multi-paxos-example\replicated_value.py", line 72, in save_state
    os.rename(tmp, self.state_file)
WindowsError: [Error 183]

I google it and it means file existed, but I don't know how to solve it. Can you help me about that?
Thanks!

Jin

@qidaneix
Copy link
Author

qidaneix commented Nov 2, 2016

Whats more, I try it on linux, ubuntu. It doesn't come out Error any more, and a.json/b.json/c.json has a log
{"current_value": "test111", "instance_number": 5, "promised_id": null, "accepted_id": null, "accepted_value": null}

@cocagne
Copy link
Owner

cocagne commented Nov 2, 2016

Interesting. Apparently it's an error on windows to rename a file to one
that already exists. On Posix file systems this is a standard mechanism for
doing atomic file updates as the filesystem itself explicitly supports this
operation and guarantees that the rename will occur atomically. The quick
fix on windows would be to just delete the file before the rename operation
if it already exists. That opens up a window during which a crash could
lose data but it's just a toy application anyway ;-)

On Wed, Nov 2, 2016 at 12:26 AM, 肖金 notifications@github.com wrote:

Whats more, I try it on linux, ubuntu. It doesn't come out Error any more,
and a.json/b.json/c.json has a log
{"current_value": "test111", "instance_number": 5, "promised_id": null,
"accepted_id": null, "accepted_value": null}


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

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