[
https://issues.apache.org/jira/browse/DRILL-6270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16440709#comment-16440709
]
ASF GitHub Bot commented on DRILL-6270:
---------------------------------------
Github user arina-ielchiieva commented on a diff in the pull request:
https://github.com/apache/drill/pull/1210#discussion_r182022171
--- Diff: distribution/src/resources/runbit ---
@@ -65,6 +65,47 @@ drill_rotate_log ()
fi
}
+args=( $@ )
+RBARGS=()
+for (( i=0; i < ${#args[@]}; i++ )); do
+ case "${args[i]}" in
+ --debug*)
+ DEBUG=true
+ DEBUG_STRING=`expr "${args[i]}" : '.*:\(.*\)'`
+ ;;
+ *) RBARGS+=("${args[i]}");;
+ esac
+done
+
+# Enables remote debug if requested
+# Usage: --debug:[parameter1=value,parameter2=value]
+# Optional parameters:
+# port=[port_number] - debug port number
+# suspend=[y/n] - pause until the IDE connects
+
+if [ $DEBUG ]; then
+ debug_params=( $(echo $DEBUG_STRING | grep -o '[^,"]*') )
+ for param in ${debug_params[@]}; do
+ case $param in
+ port*)
+ DEBUG_PORT=`expr "$param" : '.*=\(.*\)'`
+ ;;
+ suspend*)
+ DEBUG_SUSPEND=`expr "$param" : '.*=\(.*\)'`
+ ;;
+ esac
+ done
+
+ if [ -z $DEBUG_PORT ]; then
+ DEBUG_PORT=50000
+ fi
+ if [ -z $DEBUG_SUSPEND ]; then
+ DEBUG_SUSPEND='n'
+ fi
+
+ JAVA_DEBUG="-Xdebug -Xnoagent
-Xrunjdwp:transport=dt_socket,address=$DEBUG_PORT,server=y,suspend=$DEBUG_SUSPEND"
+fi
--- End diff --
Sounds reasonable to me.
> Add debug startup option flag for drill in embedded and server mode
> -------------------------------------------------------------------
>
> Key: DRILL-6270
> URL: https://issues.apache.org/jira/browse/DRILL-6270
> Project: Apache Drill
> Issue Type: Task
> Reporter: Volodymyr Tkach
> Assignee: Anton Gozhiy
> Priority: Major
> Fix For: 1.14.0
>
>
> Add possibility to run sqlline.sh and drillbit.sh scripts with --<debug flag>
> with standard java remote debug options with the ability to override port.
> {noformat}
> Usage: --debug:[parameter1=value,parameter2=value]
> Optional parameters:
> port=[port_number] - debug port number
> suspend=[y/n] - pause until the IDE connects
> {noformat}
> Examples:
> {noformat}
> drillbit.sh start --debug:port=50001,suspend=y
> drill-embedded --debug:port=50001,suspend=y
> sqlline -u "jdbc:drill:zk=[zk_address];" --debug:port=50001,suspend=y
> {noformat}
> Also should work with sqlline.bat, but in this case the debug parameters
> should be wrapped up with quotes, like:
> {noformat}
> sqlline.bat -u "jdbc:drill:zk=local;" --debug:"port=50001,suspend=y"
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)