You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/05/09 11:52:23 UTC

[GitHub] [skywalking] ynfeng commented on a change in pull request #4766: Fix #4765

ynfeng commented on a change in pull request #4766:
URL: https://github.com/apache/skywalking/pull/4766#discussion_r422486861



##########
File path: apm-sniffer/apm-sdk-plugin/sharding-jdbc-1.5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/sjdbc/ExecuteEventListener.java
##########
@@ -62,13 +62,17 @@ private void handle(AbstractExecutionEvent event, String operation) {
                 AbstractSpan span = ContextManager.createExitSpan("/SJDBC/BRANCH/" + operation, event.getDataSource());
                 if (ExecutorDataMap.getDataMap().containsKey(AsyncExecuteInterceptor.SNAPSHOT_DATA_KEY)) {
                     ContextManager.continued((ContextSnapshot) ExecutorDataMap.getDataMap()
-                                                                              .get(AsyncExecuteInterceptor.SNAPSHOT_DATA_KEY));
+                        .get(AsyncExecuteInterceptor.SNAPSHOT_DATA_KEY));
                 }
                 Tags.DB_TYPE.set(span, "sql");
                 Tags.DB_INSTANCE.set(span, event.getDataSource());
                 Tags.DB_STATEMENT.set(span, event.getSql());
                 if (!event.getParameters().isEmpty()) {
-                    Tags.DB_BIND_VARIABLES.set(span, Joiner.on(",").join(event.getParameters()));
+                    String variables = event.getParameters()

Review comment:
       event.getParameters contains null value,inside Joiner will check null value and then throw NPE

##########
File path: apm-sniffer/apm-sdk-plugin/sharding-jdbc-1.5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/sjdbc/ExecuteEventListener.java
##########
@@ -62,13 +62,17 @@ private void handle(AbstractExecutionEvent event, String operation) {
                 AbstractSpan span = ContextManager.createExitSpan("/SJDBC/BRANCH/" + operation, event.getDataSource());
                 if (ExecutorDataMap.getDataMap().containsKey(AsyncExecuteInterceptor.SNAPSHOT_DATA_KEY)) {
                     ContextManager.continued((ContextSnapshot) ExecutorDataMap.getDataMap()
-                                                                              .get(AsyncExecuteInterceptor.SNAPSHOT_DATA_KEY));
+                        .get(AsyncExecuteInterceptor.SNAPSHOT_DATA_KEY));
                 }
                 Tags.DB_TYPE.set(span, "sql");
                 Tags.DB_INSTANCE.set(span, event.getDataSource());
                 Tags.DB_STATEMENT.set(span, event.getSql());
                 if (!event.getParameters().isEmpty()) {
-                    Tags.DB_BIND_VARIABLES.set(span, Joiner.on(",").join(event.getParameters()));
+                    String variables = event.getParameters()

Review comment:
       event.getParameters contains null value,inside Joiner will check null value and then throw NPE

##########
File path: apm-sniffer/apm-sdk-plugin/sharding-jdbc-1.5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/sjdbc/ExecuteEventListener.java
##########
@@ -62,13 +62,17 @@ private void handle(AbstractExecutionEvent event, String operation) {
                 AbstractSpan span = ContextManager.createExitSpan("/SJDBC/BRANCH/" + operation, event.getDataSource());
                 if (ExecutorDataMap.getDataMap().containsKey(AsyncExecuteInterceptor.SNAPSHOT_DATA_KEY)) {
                     ContextManager.continued((ContextSnapshot) ExecutorDataMap.getDataMap()
-                                                                              .get(AsyncExecuteInterceptor.SNAPSHOT_DATA_KEY));
+                        .get(AsyncExecuteInterceptor.SNAPSHOT_DATA_KEY));
                 }
                 Tags.DB_TYPE.set(span, "sql");
                 Tags.DB_INSTANCE.set(span, event.getDataSource());
                 Tags.DB_STATEMENT.set(span, event.getSql());
                 if (!event.getParameters().isEmpty()) {
-                    Tags.DB_BIND_VARIABLES.set(span, Joiner.on(",").join(event.getParameters()));
+                    String variables = event.getParameters()

Review comment:
       event.getParameters contains null value,inside Joiner will check null value and then throw NPE




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org