Skip to content

Commit 766b602

Browse files
Add setting to control the jdwp request timeout (#863)
* Add setting to control the jdwp request timeout * Add the range constraint for the settings
1 parent 6ea8b9b commit 766b602

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ Please also check the documentation of [Language Support for Java by Red Hat](ht
117117
- `java.debug.settings.stepping.skipSynthetics`: Skip synthetic methods when stepping.
118118
- `java.debug.settings.stepping.skipStaticInitializers`: Skip static initializer methods when stepping.
119119
- `java.debug.settings.stepping.skipConstructors`: Skip constructor methods when stepping.
120-
- `java.debug.settings.limitOfVariablesPerJdwpRequest`: The maximum number of variables or fields that can be requested in one JDWP request. The higher the value, the less frequently debuggee will be requested when expanding the variable view. Also a large number can cause JDWP request timeout. Defaults to 100.
120+
- `java.debug.settings.jdwp.limitOfVariablesPerJdwpRequest`: The maximum number of variables or fields that can be requested in one JDWP request. The higher the value, the less frequently debuggee will be requested when expanding the variable view. Also a large number can cause JDWP request timeout. Defaults to 100.
121+
- `java.debug.settings.jdwp.requestTimeout`: The timeout (ms) of JDWP request when the debugger communicates with the target JVM. Defaults to 3000.
121122

122123
Pro Tip: The documentation [Configuration.md](https://github.com/microsoft/vscode-java-debug/blob/master/Configuration.md) provides lots of samples to demonstrate how to use these debug configurations, recommend to take a look.
123124

package.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -686,10 +686,17 @@
686686
"description": "%java.debugger.launch.skipConstructors.description%",
687687
"default": false
688688
},
689-
"java.debug.settings.limitOfVariablesPerJdwpRequest": {
689+
"java.debug.settings.jdwp.limitOfVariablesPerJdwpRequest": {
690690
"type": "number",
691-
"description": "%java.debugger.configuration.limitOfVariablesPerJdwpRequest.description%",
692-
"default": 100
691+
"description": "%java.debugger.configuration.jdwp.limitOfVariablesPerJdwpRequest.description%",
692+
"default": 100,
693+
"minimum": 1
694+
},
695+
"java.debug.settings.jdwp.requestTimeout": {
696+
"type": "number",
697+
"description": "%java.debugger.configuration.jdwp.requestTimeout.description%",
698+
"default": 3000,
699+
"minimum": 100
693700
}
694701
}
695702
}

package.nls.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,6 @@
5555
"java.debugger.configuration.forceBuildBeforeLaunch": "Force building the workspace before launching java program.",
5656
"java.debugger.configuration.console": "The specified console to launch Java program. If you want to customize the console for a specific debug session, please modify the 'console' config in launch.json.",
5757
"java.debugger.configuration.exceptionBreakpoint.skipClasses": "Skip the specified classes when breaking on exception. You could use the built-in variables such as '$JDK' and '$Libraries' to skip a group of classes, or add a specific class name expression, e.g. java.*, *.Foo",
58-
"java.debugger.configuration.limitOfVariablesPerJdwpRequest.description": "The maximum number of variables or fields that can be requested in one JDWP request. The higher the value, the less frequently debuggee will be requested when expanding the variable view. Also a large number can cause JDWP request timeout."
58+
"java.debugger.configuration.jdwp.limitOfVariablesPerJdwpRequest.description": "The maximum number of variables or fields that can be requested in one JDWP request. The higher the value, the less frequently debuggee will be requested when expanding the variable view. Also a large number can cause JDWP request timeout.",
59+
"java.debugger.configuration.jdwp.requestTimeout.description": "The timeout (ms) of JDWP request when the debugger communicates with the target JVM."
5960
}

package.nls.zh.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,6 @@
5454
"java.debugger.configuration.forceBuildBeforeLaunch": "在启动java程序之前强制编译整个工作空间。",
5555
"java.debugger.configuration.console": "指定的控制台用于启动Java程序。如果要为特定的调试会话自定义控制台,请修改launch.json中的“console”配置。",
5656
"java.debugger.configuration.exceptionBreakpoint.skipClasses": "当发生异常时,跳过指定的类。你可以使用内置变量,如'$JDK'和'$Libraries'来跳过一组类,或者添加一个特定的类名表达式,如java.*,*.Foo。",
57-
"java.debugger.configuration.limitOfVariablesPerJdwpRequest.description": "一次JDWP请求中可以请求的变量或字段的最大数量。该值越高,在展开变量视图时,请求debuggee的频率就越低。同时数量过大也会导致JDWP请求超时。"
57+
"java.debugger.configuration.jdwp.limitOfVariablesPerJdwpRequest.description": "一次JDWP请求中可以请求的变量或字段的最大数量。该值越高,在展开变量视图时,请求debuggee的频率就越低。同时数量过大也会导致JDWP请求超时。",
58+
"java.debugger.configuration.jdwp.requestTimeout.description": "调试器与目标JVM通信时JDWP请求的超时时间(ms)。"
5859
}

src/configurationProvider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,8 @@ async function updateDebugSettings(event?: vscode.ConfigurationChangeEvent) {
558558
stepFilters,
559559
exceptionFilters,
560560
exceptionFiltersUpdated: event && event.affectsConfiguration("java.debug.settings.exceptionBreakpoint.skipClasses"),
561+
limitOfVariablesPerJdwpRequest: Math.max(debugSettingsRoot.settings.jdwp.limitOfVariablesPerJdwpRequest, 1),
562+
jdwpRequestTimeout: Math.max(debugSettingsRoot.settings.jdwp.requestTimeout, 100),
561563
}));
562564
if (logLevel === "FINE") {
563565
// tslint:disable-next-line:no-console

0 commit comments

Comments
 (0)