[GitHub] drill pull request #1210: DRILL-6270: Add debug startup option flag for dril...

2018-04-29 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/drill/pull/1210


---


[GitHub] drill pull request #1210: DRILL-6270: Add debug startup option flag for dril...

2018-04-24 Thread agozhiy
Github user agozhiy commented on a diff in the pull request:

https://github.com/apache/drill/pull/1210#discussion_r183683315
  
--- 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=5
+  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 --

Done.


---


[GitHub] drill pull request #1210: DRILL-6270: Add debug startup option flag for dril...

2018-04-17 Thread arina-ielchiieva
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=5
+  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.


---


[GitHub] drill pull request #1210: DRILL-6270: Add debug startup option flag for dril...

2018-04-16 Thread paul-rogers
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=5
+  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.


---


[GitHub] drill pull request #1210: DRILL-6270: Add debug startup option flag for dril...

2018-04-16 Thread arina-ielchiieva
Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/1210#discussion_r181732701
  
--- Diff: distribution/src/resources/runbit ---
@@ -65,6 +65,47 @@ drill_rotate_log ()
 fi
 }
 
+args=( $@ )
+RBARGS=()
--- End diff --

Does `RBARGS` have some meaning? Maybe it better to give clearer naming?
Also please add comment describing that you remove debug string from 
original args but leave all other args.


---


[GitHub] drill pull request #1210: DRILL-6270: Add debug startup option flag for dril...

2018-04-16 Thread agozhiy
GitHub user agozhiy opened a pull request:

https://github.com/apache/drill/pull/1210

DRILL-6270: Add debug startup option flag for drill in embedded and s…

…erver mode

Works with the drillbit.sh, sqlline and sqlline.bat:
 Usage: --debug:[parameter1=value,parameter2=value]
 Optional parameters:
 port=[port_number] - debug port number
 suspend=[y/n] - pause until the IDE connects

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/agozhiy/drill DRILL-6270

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/drill/pull/1210.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1210


commit 5206268568a43864f6b0d144b56d3033c17d8031
Author: Anton Gozhiy 
Date:   2018-03-27T10:29:14Z

DRILL-6270: Add debug startup option flag for drill in embedded and server 
mode

Works with the drillbit.sh, sqlline and sqlline.bat:
 Usage: --debug:[parameter1=value,parameter2=value]
 Optional parameters:
 port=[port_number] - debug port number
 suspend=[y/n] - pause until the IDE connects




---