progressbar icon indicating copy to clipboard operation
progressbar copied to clipboard

Progress inaccurately reported

Open dmumladze opened this issue 3 years ago • 9 comments

Great little library, but I cannot seem to make it work in multi threaded environment, when threads are trying to increase the progress. I use sync block, but the program finishes and overall progress isn't increased. However, when used in a long running process, everything is working as expected.

dmumladze avatar Feb 22 '21 20:02 dmumladze

Thanks @dmumladze ! It should work properly with multiple threads. Can you paste some code snippet to show how you used it?

ctongfei avatar Feb 23 '21 00:02 ctongfei

@ctongfei thanks for replying on this.

I'm using it in this project below. The class file with line number, where it's calling progress.stepBy(n) is below as well.

https://github.com/dmumladze/cryptutil

https://github.com/dmumladze/cryptutil/blob/main/src/main/java/com/citigroup/icg/cmc/ConsoleProgressReporter.java#L13

dmumladze avatar Feb 24 '21 17:02 dmumladze

What do you mean by " but the program finishes and overall progress isn't increased"? When the program finishes, at what location is the progress bar?

ctongfei avatar Feb 25 '21 02:02 ctongfei

It finishes at random percentage but not 100%.

dmumladze avatar Feb 25 '21 14:02 dmumladze

I face the same problem

StealthyDev avatar Feb 26 '21 20:02 StealthyDev

@dmumladze Seems to be a synchronization problem among threads. Have you tried labeling the methods as synchronized in your ProgressReporter?

ctongfei avatar Mar 13 '21 05:03 ctongfei

@ctongfei I’m using 0.7.4 version now and that has no such issue.

dmumladze avatar Mar 14 '21 15:03 dmumladze

@dmumladze Thanks. This would be a regression. I'll investigate

ctongfei avatar Mar 15 '21 05:03 ctongfei

@dmumladze Can you verify if 0.8.1 works?

ctongfei avatar Mar 19 '21 18:03 ctongfei