haskell-distributed / network-transport-tcp

TCP Realisation of Network.Transport
http://haskell-distributed.github.com
BSD 3-Clause "New" or "Revised" License
30 stars 25 forks source link

[NTTCP-9] Connection crossing can block programs indefinitely #23

Closed qnikst closed 8 years ago

qnikst commented 9 years ago

[Imported from JIRA. Reported by Facundo Dominguez @facundominguez) as NTTCP-9 on 2015-05-08 21:30:44] The [comments|https://github.com/haskell-distributed/network-transport-tcp/blob/773ca26f69d79226e401665f7e6589d5c7f00977/src/Network/Transport/TCP.hs#L159-L181] in the code explain how crossing connections are resolved.

This solution, unfortunately, does not account for the possibility of connection failures.

It can be that A has a severed connection to B, but A still thinks the connection is healthy. Now, B is aware that the connection has failed, and it tries to reconnect. The result is that A will respond with {{ConnectionRequestCrossed}}, and B will wait forever an incoming connection from A.

facundominguez commented 8 years ago

This seems to be causing USend and UForward tests to block sometimes in distributed-process-tests.