Syncing doesn't finish when there are build errors #6603
Labels
awaiting-maintainer
Awaiting review from Bazel team on issues
product: IntelliJ
IntelliJ plugin
type: bug
Description of the bug:
We have a situation where the IntelliJ sync process "never finishes" when there are build errors in the Java code of our project. Well, the sync maybe finishes, but it just takes way too long due to excessive resource utilization. The way this manifests is in a stuck JetBrains Gateway or in a super-high IntelliJ memory consumption.
We have tracked this down to the BEP generated by Bazel being huge when there are build errors. In a normal sync for our project, the BEP that Bazel writes is a few hundred MBs big, but when the build fails, the BEP is several GBs in size. IntelliJ then chokes trying to process this output.
I compared the JSON BEP written with a good and a bad build and found that the bad build contains lots more
progress
andnamedSet
entries. For comparison, here is what a good build shows:and here is what a bad build shows:
I wonder if #1167 is related to what we are seeing.
The theory in my head for the above is this: if we have two chains of actions A->B->C and A->B->D, and B fails to build, then the aspect will still try to generate data for C and D, but now the build failures of B are “accounted” towards the outputs of C and D. This results in extra progress messages and extra “outputs” via
namedSet
. Propagate this throughout our large tree and we end up with this issue blowing up the size of the BEP.The problem only shows up when
--keep_going
and the plugin aspect are combined. It doesn't show up otherwise.Which category does this issue belong to?
Intellij
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Introduce a Java compilation error in a project, probably in one of the base libraries of the build graph.
Which Intellij IDE are you using? Please provide the specific version.
JetBrains Gateway 2023.3.4
What programming languages and tools are you using? Please provide specific versions.
Java
What Bazel plugin version are you using?
2024.04.23-stable
Have you found anything relevant by searching the web?
See the description.
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: