project-iris / iris

Decentralized cloud messaging
iris.karalabe.com
Other
571 stars 32 forks source link

Pending tunnels leave stale goroutines with racey quit #39

Closed karalabe closed 10 years ago

karalabe commented 10 years ago

If there are tunnel constructions pending when a client connection drops (usually because of a crashed client or a faulty protocol implementation), the afterwards successfully established tunnels are left over with running goroutines, preventing the GC from cleaning them up.

This bug is a combination of multiple ones in both proto/iris/tunnel as well as the service/relay.

karalabe commented 10 years ago

The issue is a race condition between tunnel initiation and connection tear-down in the proto/iris package. Although I've fixed it partially, it is very hard to focus on both the Erlang binding I'm doing at the moment and the Iris relay where the bug is.

Since a full trace will probably require at least a partial leveled logger implementation within the relay, I've committed the change that breaks the relay in iris-erl, commit #4d0e1bfe04c50f4c244c111491a97c1c67bdd811 and will investigate after the Erlang binding works properly.