Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syncing doesn't finish when there are build errors #6603

Open
jmmv opened this issue Jul 29, 2024 · 2 comments
Open

Syncing doesn't finish when there are build errors #6603

jmmv opened this issue Jul 29, 2024 · 2 comments
Assignees
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: IntelliJ IntelliJ plugin type: bug

Comments

@jmmv
Copy link

jmmv commented Jul 29, 2024

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 and namedSet entries. For comparison, here is what a good build shows:

...
      3     "structuredCommandLine": {
  47424     "targetCompleted": {
  47424     "targetConfigured": {
 143851     "namedSet": {
 191278     "progress": {

and here is what a bad build shows:

...
      3     "structuredCommandLine": {
  47424     "targetCompleted": {
  47424     "targetConfigured": {
1255596     "namedSet": {
1303024     "progress": {

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

@jmmv jmmv added awaiting-maintainer Awaiting review from Bazel team on issues type: bug labels Jul 29, 2024
@github-actions github-actions bot added the product: IntelliJ IntelliJ plugin label Jul 29, 2024
@tpasternak
Copy link
Collaborator

So unfortunately I can't reproduce it. Could you please try to catch a stacktrace next time it happens?

@tpasternak
Copy link
Collaborator

btw we recently found this #6577

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: IntelliJ IntelliJ plugin type: bug
Projects
None yet
Development

No branches or pull requests

3 participants