zk1931 / jzab

ZooKeeper Atomic Broadcast in Java
http://zk1931.github.io/jzab/master/
Apache License 2.0
54 stars 23 forks source link

implement a transport with 2 independent sockets for sending and receiving #177

Closed ghost closed 10 years ago

ghost commented 10 years ago

implementing a tie-breaking logic is error-prone due to netty's asynchronous nature. i think the code would be much simpler if we use two sockets for each peer, one for sending and the other for receiving.

ghost commented 10 years ago

not ready for review yet

ghost commented 10 years ago

@EasonLiao it's ready for review now

EasonLiao commented 10 years ago

I remember we discussed before, now if we clear the transport, only sender will be removed, not receiver. Let's say A has B in receiver map, B crashed and A doesn't detect that, when B tries connect A again since B is in receiver map A will reject B's connection. Is there a good way to fix this?

We can discuss it tomorrow.

EasonLiao commented 10 years ago

Thanks @m1ch1 , it would be great if we can fix our buggy transport.

ghost commented 10 years ago

when B crashes, A will detect it because the socket gets closed.

EasonLiao commented 10 years ago

when B crashes, A will detect it because the socket gets closed.

I believe this is true for most of cases. But for some cases probably this is not (e.g. the ethernet cable gets unplugged suddenly).

http://stackoverflow.com/questions/14010194/detecting-socket-disconnection

EasonLiao commented 10 years ago

How about when B connects A again and B is already in A's receiver map we just replace it directly?