Repository navigation
Various error-handling fixes - #206
Conversation
We had two "failed to initialize daemon" log messages in the `runStartCmd()` function. One can still distinguish which one was emitted since glog does print the line number too, but really that first one wasn't accurate, so tweak it.
Whenever we try to get a MachineConfig, keep retrying for 5 minutes in case we hit transient errors. One such error for example is the MachineConfig inexplicably disappearing (see openshift#199).
|
Marked as WIP for now since this does not yet address (3) in #199 (comment). |
|
Changes look good. I'm not crazy about |
|
/test e2e-aws |
2 similar comments
|
/test e2e-aws |
|
/test e2e-aws |
|
These commits are currently being manually tested by @kikisdeliveryservice and @jlebon |
|
/test e2e-aws |
2 similar comments
|
/test e2e-aws |
|
/test e2e-aws |
d65530a to
2918b77
Compare
|
OK, dropping WIP on this, though I'd appreciate some manual testing from others. I pushed another commit which reworks how we use channels and error-handling in goroutines. This allows us to avoid the nuclear reboot-on-error pattern in favour of the mark-degraded-and-exit-on-error pattern. |
There were a bunch of places where instead of propagating up the error that made us want to set the node to degraded, we were returning the error from whether setting the degraded status *itself* was successful. This resulted in e.g. callers thinking that the callee succeeded (since the node was successfully marked degraded), when in reality it should've jumped ship (see e.g. openshift#199). Fix this by adding some support functions that just "passthrough" errors instead of returning the error from setting the node annotation itself. This also centralizes where the "Marking degraded due to" msg comes from.
There's no point in fetching it if the caller already passed a specific MachineConfig to use.
This patch strengthens our error-handling and use of channels in the following ways: 1. Don't abuse the stop channel in `Run()`. It should be solely used to make sure spawned goroutines also exit when we exit. 2. Add a new `exitCh` channel which allows callbacks to communicate back to the main `poll` in `Run()` any errors that occur and exit. This means that e.g. an error in `handleNodeUpdate()` can signal an error and cause the daemon to exit cleanly instead of going with the nuclear option of rebooting. Similarly for the kubelet healthz monitor. 3. Consistently set the degraded state: previously, functions like `prepUpdateFromCluster()` were trusted to set the degraded state in the case of errors, but it didn't do so for all errors. Instead, delegate back degraded state setting to the higher-level `Run()` (in the case of errors happening during `handleNodeUpdate()` and `runOnceFromMachineConfig()` (in the in-cluster case).
2918b77 to
67d61c1
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ashcrow, jlebon The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
LGTM as well. Thanks for this @jlebon |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
|
/retest Please review the full test history for this PR and help us cut down flakes. |
Various error-handling fixes
See individual commit messages.