reubenmiller / go-c8y-cli

go c8y cli tool for interacting with the Cumulocity IoT API
https://goc8ycli.netlify.app/
MIT License
36 stars 7 forks source link

Unexpected progress bar when uploading a microservice #343

Closed ButKor closed 8 months ago

ButKor commented 8 months ago

Really more a cosmetical issue: When uploading a Microservice via c8y microservices create --file XYZ.zip -f the progress bar is immediately at 100% with an elapsed time of 0 seconds - but the process to upload the binary takes longer. IIRC in earlier versions the bar was counting step by step and the command finished once the bar reached 100%.

Tested in version 2.39.2 using the ghcr.io/reubenmiller/c8y-shell .

reubenmiller commented 8 months ago

Do you know which version it was previously ok?

ButKor commented 8 months ago

Don't know the exact version it was introduced - but e.g. in version v2.22.1 the progress bar works as expected.

ButKor commented 8 months ago

Tested a bit around, in 2.38.1 it was working as expected, the issue started to appear in 2.39.0.

reubenmiller commented 8 months ago

Tested a bit around, in 2.38.1 it was working as expected, the issue started to appear in 2.39.0.

I suspect the auto retry feature is affecting this...

reubenmiller commented 8 months ago

Investigating confirms that it is a problem with the retry feature which was introduced in 2.39.0 which uses the go-retryablehttp, however the library is more problematic than I first thought, as it will blindly load the entire body of the outgoing request into memory (due to part of its retry mechanism), for uploading large binaries this is obviously not ideal...

I'm checking if I can limit the "retry" feature to command which don't use binary uploading until I can come up with a better way to handle this...though if I can't create a short term workaround, I might just revert the "retry" feature all together...

reubenmiller commented 8 months ago

Included in v2.39.3 as the retries is now disabled by default which will not affect the progress bar.