Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-3117

Pod logs: Long lines are corrupted when using timestamps=true

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • 4.12.z
    • 4.8
    • Unknown
    • None
    • None
    • False
    • Hide

      None

      Show
      None

      This is a clone of issue OCPBUGS-3084. The following is the description of the original issue:

      Upstream Issue: https://github.com/kubernetes/kubernetes/issues/77603

      Long log lines get corrupted when using '--timestamps' by the Kubelet.

      The root cause is that the buffer reads up to a new line. If the line is greater than 4096 bytes and '--timestamps' is turrned on the kubelet will write the timestamp and the partial log line. We will need to refactor the ReadLogs function to allow for a partial line read.

      https://github.com/kubernetes/kubernetes/blob/f892ab1bd7fd97f1fcc2e296e85fdb8e3e8fb82d/pkg/kubelet/kuberuntime/logs/logs.go#L325

      apiVersion: v1
      kind: Pod
      metadata:
        name: logs
      spec:
        restartPolicy: Never
        containers:
        - name: logs
          image: fedora
          args:
          - bash
          - -c
          - 'for i in `seq 1 10000000`; do echo -n $i; done'
      
      kubectl logs logs --timestamps
      

              rhn-it-sidsharm Siddharth Sharma
              openshift-crt-jira-prow OpenShift Prow Bot
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: