Skip to content

Piping large outputs seems extremely slow or doesn't work at all.  #595

Closed

Description

@empath75

kubectl get pods -o yaml | from-yaml
is extremely slow -- on the order of 30 seconds to a minute or so to spit out any output, and it only captures part of it.

kubectl get pods -o json | from-json

Never outputs anything at all. If I hit control-c, I get:

- shell:1:28
1 |  kubectl get pods -o json | from-json
  |                             ^^^^^^^^^ input cannot be parsed as JSON
- shell:1:1
1 |  kubectl get pods -o json | from-json
  |  ------- value originates from here

Doesn't work piping to jq in nushell either. Seems like piping might hit a buffer or something and then stop?

~/nushell>  kubectl get pods -o json | jq
^Cparse error: Unfinished JSON term at EOF at line 1538, column 20
/Users/uye976/Downloads/nushell>  kubectl get pods -o json | jq
^Cparse error: Unfinished JSON term at EOF at line 1538, column 20

Works in less than a second piping to jq in bash.
the output of that command is 23,000 lines of json, fwiw.

130 ❯ kubectl get pods -o json | wc -l
   23207

Activity

  1. wycats commented on Sep 4, 2019

    @wycats
    Contributor

    Can you paste the JSON output you're trying to pipe in? Or something synthetic if there's sensitive info in there?

  2. empath75 commented on Sep 7, 2019

    @empath75
    Author

    python -c "print([i for i in range(10500)])" | from-json

    works
    python -c "print([i for i in range(11000)])" | from-json
    hangs.

    i don't think it's the parser, i think the pipe just dies at a certain point..

    even ``python -c "print([i for i in range(11000)])" | head`
    hangs

    if i hit control-c, it ends here:
    10948, 10

  3. empath75 commented on Sep 12, 2019

    @empath75
    Author

    seq 15000 | wc --bytes hangs, and ctrl-c shows that 65536 bytes were transferred before it stopped.

  4. empath75 commented on Sep 12, 2019

    @empath75
    Author

    It's probably meaningful that that is exactly 64k.

  5. sophiajt commented on Sep 13, 2019

    @sophiajt
    Contributor

    @empath75 - that repro is very helpful. I'm using it now to see if I can track down where the limit is happening

  6. sophiajt commented on Sep 14, 2019

    @sophiajt
    Contributor

    With #664, I believe I have fixed the underlying cause of the pauses/freezes. If you can, please give a recent checkout from master a try to see if it fixes the issue.

    I'll close the issue for now, but please reopen if if you can still repro with the more recent nu.

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