For the same code, I had following:
- Validation passed
- Validation failed
- It broke Jepsen (?)
The validation failed first time and when I ran again, it passed.
spoilers for 3b: gist
(ignore the mutex part, I am trying out some stuff)
Following is the buggy code:
for _, id := range state.nodeIds {
if id == state.nodeId {
continue
}
// Bug here: this is supposed to ignore the Src, not Dest
if id == msg.Dest {
continue
}
if err := n.Send(id, msg.Body); err != nil {
panic(err)
}
}
I also thought the buggy line might not be relevant. So I removed it, but I did not get the error at all. I ran it like 10 times and it passed all the time. But if I introduce if condition back, I get into issues like 1 in three runs. In failure case, I saw it was trying to send a message to client (c1
), but not sure how that happened:
2023-02-25 21:15:31,337{GMT} WARN [n1 stdout] maelstrom.process: Error!
java.lang.AssertionError: Assert failed: Invalid dest for message #maelstrom.net.message.Message{:id 1248942, :src "n1", :dest "c10", :body {:in_reply_to 4, :type "broadcast_ok"}}
In one time it broke Jepsen and it said sorry:
ERROR [2023-02-25 21:16:32,103] main - jepsen.cli Oh jeez, I'm sorry, Jepsen broke. Here's why:
clojure.lang.ExceptionInfo: Client read timeout
at slingshot.support$stack_trace.invoke(support.clj:201)
at maelstrom.client$recv_BANG_.invokeStatic(client.clj:98)
at maelstrom.client$recv_BANG_.invoke(client.clj:81)
at maelstrom.client$send_PLUS_recv_BANG_.invokeStatic(client.clj:123)
Here are jepsen analysis files: GossipGlommer:3b - Google Drive
I am happy to provide any help. Should I open this as a bug in the maelstorm or is it some issue in my code?