apps-cli-plugin icon indicating copy to clipboard operation
apps-cli-plugin copied to clipboard

Add timeout when user inputs workload through stdin

Open heyjcollins opened this issue 3 years ago • 2 comments

Description of problem

As per current behaviour, when user inputs a workload through stdin, if there is no file to read from, command keeps waiting until it's interrupted by ctrl+c command. There should be a timeout added as well as a warning message.

Proposed solution

There should be a timeout added as well as a warning message.

Given stdin is empty
When  attempting to create a workload by passing the workload.yaml from stdin 
Then the command will fail fast with a warning message indicating nothing was found in stdin

Example

Current $ tanzu apps workload create -f - -y (where stdin is empty) command will hang...

Proposed - @danfein to provide recommendation $ tanzu apps workload create -f - -y (where stdin is empty) ...

Additional context

  • #146
  • #300

Originally submitted by @warango4

heyjcollins avatar Mar 17 '22 18:03 heyjcollins

@danfein What would the error message look like when we timeout?

atmandhol avatar Apr 18 '22 18:04 atmandhol

Consider logging info for how the user can interrupt the command rather than an arbitrary timeout. If the timeout is too short, then preceding commands that take too long will no longer function, but if the timeout is too long, users who don't know how to exit are still stuck waiting. My hunch is that there is no Goldilocks zone for this timeout, the same value will be too long in some cases and too short in others.

scothis avatar May 03 '22 18:05 scothis