Skip to content

Strengthen error-handling when dealing with transient errors #395

Closed

Description

@jlebon

The MCD should not take lightly the decision to degrade a node. All I/O operations subject to a higher possibility of transient failures should be retried (e.g. API requests, file downloads, waiting for events, etc...). We need to (1) audit the whole MCD to make sure this is the case, and/or (2) add some higher-level retry logic to make sure we catch all instances and don't regress on it as new code is added.

Activity

  1. changed the title [-]Strengthen error-handling when dealing transient errors[/-] [+]Strengthen error-handling when dealing with transient errors[/+] on Feb 7, 2019
  2. runcom commented on Feb 7, 2019

    @runcom
    Member

    we could do some nice type checking on go errors for this but I fear we'll need some wrapping anyway

  3. derekwaynecarr commented on Feb 11, 2019

    @derekwaynecarr
    Member

    log from a variation of a similar problem:

    oc logs machine-config-daemon-cgwxw -n openshift-machine-config-operator -p
    I0211 19:16:42.450242   66299 start.go:52] Version: 3.11.0-595-g943ed14c-dirty
    I0211 19:16:42.451043   66299 start.go:88] starting node writer
    I0211 19:16:42.455490   66299 run.go:22] Running captured: chroot /rootfs rpm-ostree status --json
    I0211 19:16:42.526574   66299 daemon.go:166] Booted osImageURL: registry.svc.ci.openshift.org/rhcos/maipo@sha256:83a6d461628380f1dcc057ffef4909992f593b72c5aa4db2e01c0b130004afea (47.312)
    I0211 19:16:42.526828   66299 daemon.go:238] Managing node: ip-10-0-16-157.ec2.internal
    I0211 19:16:42.547911   66299 start.go:146] Calling chroot("/rootfs")
    I0211 19:16:42.577111   66299 daemon.go:443] Current+desired config: master-85b614cf21435f01ecfb1e2d3d972e2a
    I0211 19:16:42.577305   66299 daemon.go:797] No target osImageURL provided
    I0211 19:16:42.578685   66299 daemon.go:558] Validated on-disk state
    I0211 19:16:42.578706   66299 daemon.go:590] In desired config master-85b614cf21435f01ecfb1e2d3d972e2a
    I0211 19:16:42.578724   66299 start.go:165] Starting MachineConfigDaemon
    I0211 19:16:42.578730   66299 daemon.go:259] Enabling Kubelet Healthz Monitor
    E0211 19:19:44.611810   66299 streamwatcher.go:109] Unable to decode an event from the watch stream: http2: server sent GOAWAY and closed the connection; LastStreamID=89, ErrCode=NO_ERROR, debug=""
    I0211 19:21:11.434700   66299 update.go:122] Checking reconcilable for config master-85b614cf21435f01ecfb1e2d3d972e2a to master-6bca9c5b052a99be2c27a9850d1a0a1e
    I0211 19:21:11.434858   66299 update.go:161] Checking if configs are reconcilable
    I0211 19:21:11.434982   66299 update.go:309] Updating files
    I0211 19:21:11.439055   66299 update.go:519] Writing file "/etc/containers/registries.conf"
    I0211 19:21:11.441046   66299 update.go:519] Writing file "/etc/kubernetes/manifests/etcd-member.yaml"
    I0211 19:21:11.446348   66299 update.go:519] Writing file "/etc/sysconfig/crio-network"
    I0211 19:21:11.449943   66299 update.go:519] Writing file "/etc/kubernetes/static-pod-resources/etcd-member/ca.crt"
    I0211 19:21:11.452402   66299 update.go:519] Writing file "/etc/kubernetes/static-pod-resources/etcd-member/root-ca.crt"
    I0211 19:21:11.457972   66299 update.go:519] Writing file "/var/lib/kubelet/config.json"
    I0211 19:21:11.460038   66299 update.go:519] Writing file "/etc/kubernetes/ca.crt"
    I0211 19:21:11.462773   66299 update.go:519] Writing file "/etc/sysctl.d/forward.conf"
    I0211 19:21:11.465956   66299 update.go:519] Writing file "/etc/kubernetes/kubelet-plugins/volume/exec/.dummy"
    I0211 19:21:11.467076   66299 update.go:519] Writing file "/etc/kubernetes/kubelet.conf"
    I0211 19:21:11.469390   66299 update.go:453] Writing systemd unit "kubelet.service"
    I0211 19:21:11.469623   66299 update.go:491] Enabling systemd unit "kubelet.service"
    I0211 19:21:11.469845   66299 update.go:400] /etc/systemd/system/multi-user.target.wants/kubelet.service already exists. Not making a new symlink
    I0211 19:21:11.469979   66299 update.go:328] Deleting stale data
    I0211 19:21:11.470077   66299 update.go:615] Writing SSHKeys at "/home/core/.ssh"
    I0211 19:21:11.472052   66299 update.go:647] No target osImageURL provided
    I0211 19:21:11.472174   66299 update.go:76] Update prepared; draining the node
    I0211 19:21:11.540452   66299 daemon.go:660] Unable to apply update: rpc error: code = Unknown desc = 
    E0211 19:21:11.540747   66299 writer.go:91] Marking degraded due to: rpc error: code = Unknown desc = 
    E0211 19:21:19.271240   66299 writer.go:114] Error while setting degraded: Unable to update node "ip-10-0-16-157.ec2.internal": etcdserver: request timed out
    F0211 19:21:19.271374   66299 start.go:170] failed to run: rpc error: code = Unknown desc = 
  4. runcom commented on Feb 18, 2019

    @runcom
    Member

    This is still open because we want to use the lister from the node informer when getting the node (we're still using the kubeclient and a wait.Pool* to get the nodes and that can fail directly). Other than than that, interactions with kubeclient (and the others) should never result in permanent degrade of the node e.g. transiet errors) so we should wrap and retry + handle rollback if we did something.

    I believe a model where we do have transactions and only call the clients to update at the end would be beneficial as we can roll back the whole transaction if we fail to talk to the api server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions