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

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

    XMLWordPrintable

Details

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

      None

      Show
      None

    Description

      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
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: