microsoft / microsoft/vscode-java-debug

Compound Launch Config Debug Port Clash

オープン
#1,522 コメント 4 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

ai-triaged bug
主要言語
TypeScript
スター
591
フォーク
429
平均マージ
1日 9時間
マージ済み PR(30日)
19

説明

I'm running into an issue / potential bug where my compound launch configuration tries to run multiple services with the same java debug port. This seems to be a non-deterministic issue and the launch configurations that succeed vary.

Here's a version of my launch config:

  "version": "0.2.0",
  "configurations": [
    {
      "type": "java",
      "name": "AxonServer",
      "request": "launch",
      "mainClass": "org.springframework.boot.loader.PropertiesLauncher",
      "classPaths": [
        "${workspaceFolder}/build/AxonServer/axonserver.jar"
      ],
      "console": "internalConsole",
      "cwd": "${workspaceFolder}/build/AxonServer",
    },
    {
      "type": "java",
      "name": "EurekaServer",
      "request": "launch",
      "mainClass": "com.company.project.framework.eureka.server.EurekaServerApplication",
      "projectName": "com.company.project.framework-eureka-server",
      "console": "internalConsole",
    },
    {
      "type": "java",
      "name": "Config Service",
      "request": "launch",
      "mainClass": "com.company.project.config.service.ConfigApplication",
      "projectName": "com.company.project-config-service",
      "console": "internalConsole",
    },
    {
      "type": "java",
      "name": "Framework Service",
      "request": "launch",
      "mainClass": "com.company.project.framework.FrameworkApplication",
      "projectName": "com.company.project-framework",
      "console": "internalConsole",
    },
    {
      "type": "java",
      "name": "Command Service",
      "request": "launch",
      "mainClass": "com.company.project.framework.commandservice.CommandApplication",
      "projectName": "com.company.project.framework-command-service",
      "console": "internalConsole",
    },
    {
      "type": "java",
      "name": "Query Service",
      "request": "launch",
      "mainClass": "com.company.project.framework.queryservice.QueryApplication",
      "projectName": "com.company.project.framework-query-service",
      "console": "internalConsole",
    },
    {
      "type": "java",
      "name": "Generation Service",
      "request": "launch",
      "projectName": "com.company.project.generation-generation",
      "mainClass": "org.springframework.boot.loader.launch.JarLauncher",
      "classPaths": [
        "${workspaceFolder}/build/generation.jar"
      ],
      "console": "internalConsole",
      "cwd": "${workspaceFolder}\\build",
    },
  ],
  "compounds": [
  {
    "name": "Start Microservices",
    "configurations": [
      "AxonServer",
      "EurekaServer",
      "Config Service",
      "Framework Service",
      "Command Service",
      "Query Service",
      "Generation Service",
    ],
    "stopAll": true,
  },
]

I get this error for several services on most launch attempts:

Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 45559; nested exception is: 
	java.net.BindException: Address already in use: bind
jdk.internal.agent.AgentConfigurationError: java.rmi.server.ExportException: Port already in use: 45559; nested exception is: 
	java.net.BindException: Address already in use: bind
	at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap.startRemoteConnectorServer(ConnectorBootstrap.java:491)
ConnectorBootstrap.java:491
	at jdk.management.agent/jdk.internal.agent.Agent.startAgent(Agent.java:447)
Agent.java:447
	at jdk.management.agent/jdk.internal.agent.Agent.startAgent(Agent.java:603)
Agent.java:603
... (trimmed)
Caused by: java.net.BindException: Address already in use: bind

When I check that port, one of my other configurations is indeed using that port. This is not a port used by the applications themselves, but presumably the java debug server port. When I stop my applications, those ports are no longer in use. I can also run the non-compound launch configs individually without issue, this is specifically a compound launch config issue.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

提供された VS Code compound launch configuration で失敗を再現し、複数のサービスを同時に起動したときの Java debug-agent ポートの割り当てを確認します。compound launches と個別に動作する構成を比較します。完了の条件は、一覧にあるすべてのサービスを同時に起動でき、同じデバッグポートを奪い合わないことです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java, vscode
領域
devtools
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。