SeattleTestbed / nodemanager

Remote control server for SeattleTestbed nodes
MIT License
0 stars 10 forks source link

nodemanager needlessly respawns advertise threads #94

Open aaaaalbert opened 10 years ago

aaaaalbert commented 10 years ago

The main nodemanager thread includes logic to ensure that the helper threads it requires for functioning correctly keep running at all times. There is an accepter thread taking care of experimenters connecting to vessels, a status monitoring thread for vessels, and also an advertisement thread that announces the node and its vessels under the associated user/node/testbed public keys. Previously, issue #60 (and #93) described a problem with the advertise thread that would occur on nodes that went offline and online again (like my laptop).

Here's a synopsis of what happens. The advertise thread takes diverse public keys and advertises the node's "name" per the variable myname under it. The existing logic was introduced by and large in SVN r11 (!) already. It assumes that myname is the node's IP address, so whenever it changes, a new advertise thread is spawned that advertises the new name. (Back when most Seattle nodes never changed IP addresses, this would hardly ever happen.) While there exists a function to check for the existence of a previous advertise thread, is_advert_thread_started(), it is never called, and new threads spawned regardless. This is an obvious bug that requires fixing.

Furthermore, now that we incorporate Affix into the nodemanager, myname has become a static string, sha_hash(node_pubkey) + "zenodotus.poly.edu", and we advertise the current IP pointed to my myname separately (not in the advertise thread). Thus, the advertise thread can continue to announce what it has, and IP address changes will be addressed in a different part of the logic.