-
Notifications
You must be signed in to change notification settings - Fork 7.9k
fix: simplify debug handling and remove the 0.0.0.0 default #43574
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
Changes from all commits
d866caa
8b0781f
26cb1a6
79cafe7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,9 +42,8 @@ SERVER_OPTS="$SERVER_OPTS -Dquarkus-log-max-startup-records=10000" | |
| CLASSPATH_OPTS="'$(abs_path "../lib/quarkus-run.jar")'" | ||
|
|
||
| DEBUG_MODE="${KC_DEBUG:-${DEBUG:-false}}" | ||
shawkins marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| DEBUG_PORT="${KC_DEBUG_PORT:-${DEBUG_PORT:-8787}}" | ||
| DEBUG_ADDRESS="${KC_DEBUG_PORT:-${DEBUG_PORT:-8787}}" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we should really rely on the default behaviour here with the address. Maybe we could add the explicit
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can trust the JRE behavior.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you see any downsides if we state the address explicitly? Feels safer to me.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From what we have documented there wouldn't be a downside to specify localhost:8787. From a jdwp perspective there could eventually be other ways to affect the default address, which this would prevent. I'm now thinking that adding the handling for specifying the address only, without the port, was a mistake as it will futher deviates from the jdwp handling and adds a little more complexity to our scripts. If there are no objections, I'll remove that with this pr as well.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering if we should even rely so much on this kind of debug logic. JAVA_OPTS, JAVA_OPTS_APPEND are perfectly capable of accomodating the options. https://docs.oracle.com/en/java/javase/21/docs/specs/jpda/conninv.html - it looks like users may want to control virtual thread listing, the allow list if using a publically accessible address, etc. Maybe we should just update the doc to provide an example of using an environment variable. There is probably even a case to be made for handling -X arguments in the same way we are handling -D. @keycloak/cloud-native WDYT?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vmuzikar are you ok with leaving localhost off, or do you want it on? I can add that, but it will need similar handling as to what was removed for supporting ip only - that is check for a number only after parsing so that it's applied to both the env and the cli cases. |
||
| DEBUG_SUSPEND="${KC_DEBUG_SUSPEND:-${DEBUG_SUSPEND:-n}}" | ||
| DEBUG_ADDRESS="0.0.0.0:$DEBUG_PORT" | ||
|
|
||
| esceval() { | ||
| printf '%s\n' "$1" | sed "s/'/'\\\\''/g; 1 s/^/'/; $ s/$/'/" | ||
|
|
@@ -55,20 +54,9 @@ do | |
| case "$1" in | ||
| --debug) | ||
| DEBUG_MODE=true | ||
| if [ -n "$2" ]; then | ||
| # Plain port | ||
| if echo "$2" | grep -Eq '^[0-9]+$'; then | ||
| DEBUG_ADDRESS="0.0.0.0:$2" | ||
| shift | ||
| # IPv4 or bracketed IPv6 with optional port | ||
| elif echo "$2" | grep -Eq '^(([0-9.]+)|(\[[0-9A-Fa-f:]+\]))'; then | ||
| if echo "$2" | grep -Eq ':[0-9]+$'; then | ||
| DEBUG_ADDRESS="$2" | ||
| else | ||
| DEBUG_ADDRESS="$2:$DEBUG_PORT" | ||
| fi | ||
| shift | ||
| fi | ||
| if echo "$2" | grep -Eq '^([0-9]|\[)'; then | ||
| DEBUG_ADDRESS=$2 | ||
| shift | ||
| fi | ||
| ;; | ||
| --) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.