Skip to content

Analysis hangs on second/third run — Java provider connection disposed #1366

@fabianvf

Description

@fabianvf

Description

Analysis hangs on the 2nd or 3rd consecutive run, consistently getting stuck around the same rule. The first analysis run always succeeds. Stopping and restarting the analysis server resolves the issue — subsequent runs succeed again until the pattern repeats.

Status: Needs Verification

Note: This was reported by a user. The root cause may be in the Java provider binary rather than the IDE extension, but we should track and handle it on our end (e.g., detection, timeout, automatic recovery, better error reporting). We do not currently have access to the project directory or rules that triggered this, so a first step will be finding a reproducer.

Key Observations from Logs

  1. RPC connection dies: "Pending response rejected since connection got disposed" — the pipe from the RPC layer to the Java extension is breaking.

  2. File walk failure: failed to search for files ... error="failed to walk all dirs - lstat : no such file or directory" — the Java provider fails to walk the project directory on subsequent runs.

  3. Unbounded search scope: "could not construct dep label selector from condition context, search scope will not be limited" — the label selector is empty/invalid, causing the provider to search through open source dependencies unnecessarily. This may contribute to memory pressure.

Hypotheses Under Investigation

  • Memory leak / exhaustion: The incorrect label selector causes the provider to search through far more code than necessary. Across repeated analysis runs (with the Java provider, jdtls, and RPC server all staying up as expected), accumulated memory pressure could cause the provider to crash or the RPC connection to break.
  • Stale state accumulation: The Java provider or jdtls may accumulate stale internal state across analysis runs that eventually causes failures, even though they remain running.
  • File system state changes: The build tool may create settings/project files after the first run that cause lstat failures on subsequent file walks (e.g., symlinks, temporary files).

Workaround

Stopping and restarting the analysis server before re-running analysis resolves the issue every time.

Expected Behavior

Analysis should complete reliably on consecutive runs without needing to restart the analysis server. If the Java provider encounters an error, the extension should detect the failure and either recover automatically or surface a clear error to the user rather than hanging indefinitely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingkind/bugCategorizes issue or PR as related to a bug.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions