<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 3, 2019 at 11:56 AM Adam Lindberg <<a href="mailto:hello@alind.io">hello@alind.io</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi!<br>
<br>
I’m running some tests using distributed Erlang. I set up a cluster of Erlang nodes doing Distributed Systems™ stuff, and a hidden node that have a connection to each of the nodes in that cluster. The hidden node orchestrates the test by starting all Erlang nodes as ports. It then starts a process (gen_server) on each node that manipulates stuff on that node. It also loads some mock modules among other things. The hidden node also has some managing gen_servers running locally, which some of the mocks makes RPC calls to from the cluster nodes (to simulate and orchestrate mocked hardware components).<br>
<br>
Now I wanted to test how my system behaves when killing some random nodes, chaos monkey style. So I picked the easiest option of using rpc:cast(RandomClusterNode, erlang, halt, [137]). However, now my test dies with the following obscure error: ** exception exit: noconnection. This even happens when first spawning a fun that then calls erlang:halt(137) (as to avoid the RPC connection somehow breaking).<br>
<br>
After searching a bit on the Internet it seems to be some internal uncatchable (!) error generated by Erlang [1][2], but it is not at all clear when it happens, and how to avoid it. After some debugging in the gen_servers running on the hidden node, I can see the error by setting process_flag(trap_exit, true) and printing it in terminate/2 but I still can’t catch it. I can’t even catch it in the shell by enclosing my run in a try-catch block! It’s almost not mentioned at all in the official documentation [3]. Most likely I’m setting up my test nodes and the application/test code in a way that generates this error, but I have no idea what exactly leads to it.<br>
<br>
I guess I have two problems:<br>
<br>
1. What is the error, and how can I handle / avoid it?<br></blockquote><div><br></div><div>I'm not sure, but could it be that your process is linked to a process on the remote side? That what you are getting is a broken link error?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
2. Why is it not documented?<br>
<br>
Cheers,<br>
Adam<br>
<br>
<br>
[1]: <a href="http://erlang.org/pipermail/erlang-questions/2012-April/066219.html" rel="noreferrer" target="_blank">http://erlang.org/pipermail/erlang-questions/2012-April/066219.html</a><br>
[2]: <a href="http://erlang.org/pipermail/erlang-questions/2013-April/073246.html" rel="noreferrer" target="_blank">http://erlang.org/pipermail/erlang-questions/2013-April/073246.html</a><br>
[3]: <a href="http://erlang.org/doc/getting_started/robustness.html" rel="noreferrer" target="_blank">http://erlang.org/doc/getting_started/robustness.html</a><br>
<br>
</blockquote></div></div>