Skip to content

Unable to start Java debugging: Unable to wait on tcp due to maxmium timeout reached #1460

Closed

Description

@dwhmofly

Extension Name: vscode-gradle
Extension Version: v3.13.5
OS Version: Windows 11 22H2
VSCode version: 1.85.0

Describe the bug
debug task bootRun. It need a few minutes to compile the program, and it timed out in about 1 minute, and then the task stopped.

To Reproduce
debug task bootRun

Expected behavior
wait the program compiled and start debug

Screenshots
微信截图_20231208162642

Output from "Gradle for Java"
[warn] [gradle-server] Adding ics-cs-rebirth-startup:cleanBootRun to ensure task output is cleared before debugging
[error] Unable to start Java debugging: Unable to wait on tcp due to maxmium timeout reached
[info] Cancel build: Cancel build requested
[info] Build cancelled: ics-cs-rebirth-startup:bootRun: Could not execute build using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-6.9.1-bin.zip'.
[info] Completed build: ics-cs-rebirth-startup:bootRun

Does the bug still exist if you disable all other extensions?
Yes

Additional context
Is there any configuration item that can set the timeout? I didn't find it in the instructions. Debugger for Java Extension's configuration has a timeout setting, I set it to 300000ms, but it has no effect.
If I execute the build task first and then debug the bootRun task, I can debug normally.

Activity

  1. jdneo commented on Dec 12, 2023

    @jdneo
    Member

    The timeout defined in code is here:

    const maximumTimeout = 60000; // ms

    Looks like the current implementation is using an infinite loop with a 1 min timeout to check if the debug port is open.

    A better solution should be listen the output of the task, when the sentence: Listening for transport dt_socket at address: xxx appear, then start the debug session.

  2. github-actions commented on Nov 5, 2025

    @github-actions

    Hi woden17 (@dwhmofly), I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.

    The Gradle extension uses a hard-coded 10 s TCP wait in waitOnTcp(), and there is currently no setting to increase it. You have two options:

    • Workaround: Run your Gradle build (bootRun) first (e.g. via the built-in VS Code “Run Task”), then attach the debugger to the already-running process.
    • Patch locally: in your VS Code extensions folder, edit vscode-gradle/.../util/index.ts, change the total timeout (currently 10_000 ms) passed to waitOnTcp(), then reload the extension.

    If you’d like an official timeout setting, please file an enhancement request against the Gradle for Java extension.

    High-confidence reference:

    • Issue #1258: shows the waitOnTcp() implementation with a fixed 10 s timeout
    #1258 (comment)

    Other references with low confidence

    • Issue #669: timeout exception in Java Debug when changing default terminal—different code path (Java Debug extension)
    microsoft/vscode-java-debug#669

    The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!

  3. mayamalkoti-xceedance commented on Jul 28, 2026

    @mayamalkoti-xceedance

    their is only dist in my version of this extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions