Progress indicator is not closed in some instances
Hi all,
I have a problem where a progress indicator is not closed in some rare instances. The code which starts the task can be found here: https://gitlab.com/ppiag/intellij_gitlab_pipeline_monitor/-/blob/master/src/main/java/de/sist/gitlab/BackgroundUpdateService.java#L76
I have found no pattern when this happens. I have a button which starts this task and I can click it multiple times and everything works as expected but the task is also periodically started by a background task and at some point, sooner or later, I see the progress indicator which doesn't close and doesn't have a task behind it (as far as I can tell).
Is there any way to debug this?
I found the line `2021-04-28 19:46:45,546 [16121866] WARN - .AbstractProgressIndicatorBase - This progress indicator is indeterminate, this may lead to visual inconsistency. Please call setIndeterminate(false) before you start progress.
git4idea.commands.GitStandardProgressAnalyzer$1.onLineAvailable(GitStandardProgressAnalyzer.java:46) ` which may indicate a bug but probably(?) isn't related to my problem.
Thank you.
Please sign in to leave a comment.
Anybody? I'm close to just not using a progress indicator (or using an inivisible one) but that's not really a solution...
To verify that it "doesn't have a task behind it" you can take a thread dump in this moment and post it here. (Or analyze it yourself to see if the background task really is completed or stuck somewhere)
Alexey Kudravtsev Thanks for the response.
This is my thread dump: https://pastebin.com/82M2GeuC
No threads related to my code (package "de.sist.*") are contained. Three progress indicators are still open:
I see one thread related to `com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:773)` which seems to be the one that draws the actuall display.
Alexey Kudravtsev
I recently found out that this happens if the task is completed too quickly. I now start a stopwatch at the beginning and if the elapsed time before completion is less than 500ms I just sleep for 500ms. I'm pretty sure there's a bug in the code that's supposed to not show a progress bar when a task is only active for a short time.
Wow, if you were able to reproduce this, it would be a great find, thank you!
Alexey Kudravtsev
I was able to reproduce it with a simple demo class: https://pastebin.com/i54W1h2c
It seems to be related to the AppScheduledExecutorService. When starting the background process task from the GUI the bug doesn't happen.
Thanks for trying to reproduce. However, I was unable to reproduce the reproducer D)
>When starting the background process task from the GUI the bug doesn't happen.
Then how to start it?
Please use https://gitlab.com/simon.stratmann/intellijprogressbarbugreproducer
Result:
Hello Simon.
I'm still unable to reproduce this. Stranger things happen indeed.
1) Does it reproduce when you replace
with
2) What version do you use? Does it reproduce in the latest EAP (https://confluence.jetbrains.com/display/IDEADEV/IDEA+2021.2+latest+builds ) ?
The problem does indeed not occur on 212.4638.7-EAP-SNAPSHOT
It does occur on 203.8084-EAP-CANDIDATE-SNAPSHOT.
I'm still on 2020.3 due to some nasty bugs in 2021 (but that's another matter).
Of course that was a stupid error in my reproducer code but even with `ProgressManager.getInstance().runProcessWithProgressAsynchronously(longRunningTask, new BackgroundableProcessIndicator(longRunningTask))` the progress bar doesn't go away.
Thank you very much for trying to reproduce this. I think we'll leave this as is, because there were quite a number of changes in ProgressManager subsystem since 2020.3 and backporting them all to 2020.3 is problematic.
I am on IntelliJIdea2021.2
Same here with IntelliJ IDEA 2021.2.3 Ultimate Edition
Thanks for reporting!
The issue related to the mentioned SharedIndexDownloadExecutor warning cause is already handled – the fix is available in the 2021.3 release cycle: https://youtrack.jetbrains.com/issue/IDEA-272135