[
https://issues.apache.org/jira/browse/AMBARI-24851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16669731#comment-16669731
]
ASF GitHub Bot commented on AMBARI-24851:
-----------------------------------------
adoroszlai commented on a change in pull request #15: AMBARI-24851 - Logsearch:
debug mode using java 8 and 11
URL: https://github.com/apache/ambari-logsearch/pull/15#discussion_r229597012
##########
File path: ambari-logsearch-server/src/main/scripts/logsearch.sh
##########
@@ -149,7 +149,11 @@ function start() {
LOGSEARCH_DEBUG_PORT=${LOGSEARCH_DEBUG_PORT:-"5005"}
if [ "$LOGSEARCH_DEBUG" = "true" ]; then
- LOGSEARCH_JAVA_OPTS="$LOGSEARCH_JAVA_OPTS -Xdebug
-Xrunjdwp:transport=dt_socket,address=*:$LOGSEARCH_DEBUG_PORT,server=y,suspend=$LOGSEARCH_DEBUG_SUSPEND
"
+ if [ $java_version == "8" ]; then
+ LOGSEARCH_JAVA_OPTS="$LOGSEARCH_JAVA_OPTS -Xdebug
-Xrunjdwp:transport=dt_socket,address=$LOGSEARCH_DEBUG_PORT,server=y,suspend=$LOGSEARCH_DEBUG_SUSPEND
"
+ else
+ LOGSEARCH_JAVA_OPTS="$LOGSEARCH_JAVA_OPTS -Xdebug
-Xrunjdwp:transport=dt_socket,address=*:$LOGSEARCH_DEBUG_PORT,server=y,suspend=$LOGSEARCH_DEBUG_SUSPEND
"
Review comment:
Sorry for nitpicking, but please consider a more DRY version, like this:
```
if [ $java_version == "8" ]; then
LOGSEARCH_DEBUG_ADDRESS=$LOGSEARCH_DEBUG_PORT
else
LOGSEARCH_DEBUG_ADDRESS="*:$LOGSEARCH_DEBUG_PORT"
fi
LOGSEARCH_JAVA_OPTS="$LOGSEARCH_JAVA_OPTS -Xdebug
-Xrunjdwp:transport=dt_socket,address=$LOGSEARCH_DEBUG_ADDRESS,server=y,suspend=$LOGSEARCH_DEBUG_SUSPEND
"
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Logsearch: debug mode using java 8 and 11
> -----------------------------------------
>
> Key: AMBARI-24851
> URL: https://issues.apache.org/jira/browse/AMBARI-24851
> Project: Ambari
> Issue Type: Bug
> Components: ambari-logsearch
> Affects Versions: 2.8.0
> Reporter: Krisztian Kasa
> Assignee: Krisztian Kasa
> Priority: Major
> Labels: pull-request-available
> Fix For: 2.8.0
>
>
> Logsearch server can not be started in debug mode if Logsearch is running in
> an Ambari managed cluster using java 8
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)