[ 
https://issues.apache.org/jira/browse/DRILL-6270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16439667#comment-16439667
 ] 

ASF GitHub Bot commented on DRILL-6270:
---------------------------------------

Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1210#discussion_r181799954
  
    --- 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 --
    
    This is overly complex and puts Drill in the business of tracking the 
arguments that the JVM wants to enable debugging. Those flags changed in the 
past and may change again.
    
    Would recommend instead:
    
    ```
    --jvm -anyArgumentYouWant
    ```
    
    Multiple `--jvm` arguments can appear. Simply append this to the the 
`DRILL_JAVA_OPTS` variable. Very simple.


> 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)

Reply via email to