puppetlabs/Razor-Microkernel — pull request #5 by tjmcs (2012-09-11 13:20:01+00:00)
Title: Fix for "uninitialized constant RxNetworkUtils" reported Razor Issue #178

Fixes the "uninitialized constant RxNetworkUtils" error that was reported by @eoghank in the discussion of issue #178 in the Razor issues list. The error was triggered by the fact that in some situations the newer version of the TCL kernel used in v0.9.0.0 and later of the Razor Microkernel was failing to initialize the underlying NICs before the "bnx2" kernel module was loaded, so the network was never discovered (and the aforementioned error was thrown by a syntax error in the error handling code of the Microkernel initialization script).

This pull request fixes all of those issues (and a few others that were discovered along the way). Here is a brief list of the changes that have been made in this pull request:

* The formerly linear timing of the search for the underlying network (which checked every 15 seconds or so until a network was found or the check timed out) has been changed to an exponential backoff algorithm (with subsequent checks occuring with an exponentially longer wait after each failed check until the timeout wait time is exceeded)
* The timeout value has been shortened from the exceedingly long wait in the previous (v0.9.0.5) version of the Microkernel to a much more reasonable 2 minute total wait time. If the search for the network exceeds 2 minutes, then the system will quit searching (and the Microkernel initialization process will stop, since there is no network available).
* Additional output to the console was added to the process so that users can see what is happening during the network search (previously the console just sat there with no feedback for the user occuring until either a network was discovered or the network discovery process failed).
* The code that was causing the "uninitialized constant RxNetworkUtils" error was changed, it now reports the correct error (that a valid NIC could not be found or that NIC does not have a valid IP address assigned to it).
* If a valid NIC is not found when searching for the network as part of the Microkernel initialization process, the bnx2 firmware kernel module is reloaded (if it is loaded) in order to trigger rediscovery of the underlying network
* If a valid IP address was not assigned to the NIC, then the DHCP client is restarted to trigger a new DHCP request to the server

After this pull request is accepted, we will tag the repository with the next version number for the Microkernel (v0.9.2.0?). A beta Microkernel based on the code contained in this pull request is currently available in the downloads area (v0.9.1.3).