<div dir="ltr">Dear all,<br><br>I am a beginner in Erlang and I'm working on a project.<br>I am working with nodes that need to connect and disconnect frequently both in "visible" and "hidden" mode.<br><br>I wonder if there is a bug in net_kernel, because I observe the following unexpected behaviour and I'm unable to link it to any action caused by my code.  <div><br>What happens in the execution of my program is roughly the following:<br>initial state: node A is connected (in visible mode) to node B,<div>                   node D is not connected to any other node</div><div>then:<br><div><div>1) node A disconnects from B (using net_kernel:disconnect/1)</div></div><div>2) node A connects to node D (using net_kernel:connect_node/1)</div><div>result: somehow D receives nodeup messages and connects to both A and B</div></div></div><div>expected behaviour: node D should connect to just A, while B should be connected to no one</div><div><br></div><div>Note that steps 1 and 2 are executed sequentially in the same function so there's no way they could be concurrent.</div><div><br></div><div>Could this be a bug in net_kernel? </div><div>I thought that maybe, somehow A has some messages related to net_kernel that hang up in a way such that when step 2 happens, node A is not yet disconnected completely from B?</div><div>Is it possible that something like that happens? If yes, how can I avoid this?  </div><div><br></div><div>Even if I'm pretty confident that my code works as intended and I tried to debug and check it several times, of course the other option is that this could be caused by a bug in my code.</div><div>Of course there are a lot of other processes involved that I can't explain here, but let's suppose that they don't cause any interference with the example.</div><div><br></div><div>I hope someone who knows Erlang better than me can help me clarify my doubts.</div><div><br></div><div>Thank you,<br>Lorenzo.</div></div>