vbauerster / mpb

multi progress bar for Go cli applications
The Unlicense
2.29k stars 123 forks source link

Possible content corruption #45

Closed falzm closed 5 years ago

falzm commented 5 years ago

Hi,

We're investigating a weird content corruption in our S3-compatible CLI tool, which is using the minio/minio-go/v6 and mpb/v4 packages. We've opened an issue at minio-go to discuss the problem, and while performing tests we've found out that the content corruption is directly linked to the progress bar usage. Could you please have a look at this and point to us to a potential misuse of your package in our code? That'd be great to help ruling out possibilities :)

vbauerster commented 5 years ago

Hi, this lib doesn't alter io content by any means. It provides single wrapper around io.Reader here. This wrapper doesn't distinguish whether underlying io.Reader is upload or download.

vbauerster commented 5 years ago

I think my old comment here could be related to your issue.

falzm commented 5 years ago

Thank you for your response. I wasn't implying your lib was actively altering the content, rather that a misuse of it could lead to the problem we're facing.

vbauerster commented 5 years ago

Possible misuse in your code: it's strange that you have two readers both sharing single source, then passing those readers at the same time in one call:

falzm commented 5 years ago

Do you mean that it should be the same reader used in both cases (the one returned by bar.ProxyReader(f))?

vbauerster commented 5 years ago

I'm not sure, it's not clear for me why that minio call requires two readers. You may try to omit line 186, and replace f with bar.ProxyReader(f) at line 182.

falzm commented 5 years ago

Hi, just to let you know the issue has been fixed. You were on the right track, it was indeed caused by a wrong reader usage: https://github.com/exoscale/cli/pull/157

Thank you for your time!