Must pay attention to the documentation (Erlang Edition)

Right there, in the documentation for supervisor, it says (emphasis mine)
Creates a supervisor process as part of a supervision tree. The function will, among other things, ensure that the supervisor is linked to the calling process (its supervisor).
And I know this.
Really.
It's just that I, apparently, didn't know it for the last 8 hours.
So there I am, writing out Common Tests for our system, and in init_per_suite I slap in (basically) the following line
supervisor:start_link({local, some_module_sup}, some_module_sup, []).
Wonder of wonders, everything craps out.  After an eternity (ok, 8 hours), I figured out that
  1. init_per_suite runs will executed in its own dedicated process (as oh so helpfully stated multiple times in the documentation, and which I not only know, but have expounded on multiple times in the past)
  2.  supervisor:start_link/3 links to its calling process, which is right there in the second line of its documentation as show above.  Granted, the calling process is probably a supervisor of its own, all the way to the top when its probably an application bootstrapping the whole thing, but still, I know this.
Put the two together, and it is exceedingly obvious that I deserve no sympathy whatsoever.  Apparently "Mahesh" is spelled I-D-I-O-T...





Comments

Popular posts from this blog

Erlang, Binaries, and Garbage Collection (Sigh)

Cannonball Tree!