I’ve understood PID:s change when they pass a node barrier. I.E, PID 0,2,2 on the local node A is automatically translated to I.E. 5.2.2 on a remote node B.
Can then node B pass the PID to node C, which will then answer node A? Or will the PID reference break on the last transfer?
And if it works, do I need to pay any special attention to the case when C gets the message on startup, possibly before fully discovering node A?
I’ve been doing experiments on this inside a bigger application, but I’ve been having such mixed results, I’m starting to suspect any success is accidental, not at all by design
One of the major benefits of the BEAM is that you do not need to care if a process runs on your own machine or remote if you know its name or PID, so everything should be fine.
Allright. Any idea about why I’m occasionally, when doing Process.monitor() on node C, sometimes (more often in a larger cluster) get a {:DOWN … :noproc} reported?
I read that too. Yet, the process is clearly running (it’s also monitored locally under node A, and that monitor did not trigger)
I’m thinking, another possible explanation to be, because the node is not known to the other node right now (for some reason)?
For example, Process.monitor(:c.pid(3,2,1)) will also trigger :noproc, not distinguishing between “process is actually confirmed to not be running at node” and “node not known/connected”?
You are correct. I wrongly assumed that :c.pid were a direct struct initializer.
I’ve gotten it all working now, with some extra calls to :global.sync regularly. Not sure exactly why that helped, though.
As a side-note; I think I’ll be moving the entire design to named processes instead. It wasn’t feasible a couple of weeks ago, but has since become a very reasonable redesign.