You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/01/05 11:12:39 UTC

[GitHub] [pulsar] eolivelli opened a new pull request #9131: Issue 9130: Pulsar-admin sinks create: bad error message "java.lang.NullPointerException: path is 'null'." in case of missing "--name" parameter

eolivelli opened a new pull request #9131:
URL: https://github.com/apache/pulsar/pull/9131


   Fixes #9130
   
   ### Motivation
   Return a better error to the user
   
   ### Modifications
   Add an explicit validation and do not let WebTarget#path throw an internal error.
   
   ### Verifying this change
   This change added unit tests
   


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



[GitHub] [pulsar] eolivelli commented on a change in pull request #9131: Issue 9130: Pulsar-admin sinks create: bad error message "java.lang.NullPointerException: path is 'null'." in case of missing "--name" parameter

Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #9131:
URL: https://github.com/apache/pulsar/pull/9131#discussion_r553194788



##########
File path: pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinksImpl.java
##########
@@ -232,6 +233,10 @@ public void createSink(SinkConfig sinkConfig, String fileName) throws PulsarAdmi
     @Override
     public CompletableFuture<Void> createSinkAsync(SinkConfig sinkConfig, String fileName) {
         final CompletableFuture<Void> future = new CompletableFuture<>();
+        if (StringUtils.isBlank(sinkConfig.getName())) {

Review comment:
       @sijie I have added validation for all of the methods in SinksImpl for sinkname, namespace and tenant.
   PTAL




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



[GitHub] [pulsar] eolivelli commented on pull request #9131: Issue 9130: Pulsar-admin sinks create: bad error message "java.lang.NullPointerException: path is 'null'." in case of missing "--name" parameter

Posted by GitBox <gi...@apache.org>.
eolivelli commented on pull request #9131:
URL: https://github.com/apache/pulsar/pull/9131#issuecomment-756187225


   /pulsarbot rerun-failure-tests


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



[GitHub] [pulsar] eolivelli commented on pull request #9131: Issue 9130: Pulsar-admin sinks create: bad error message "java.lang.NullPointerException: path is 'null'." in case of missing "--name" parameter

Posted by GitBox <gi...@apache.org>.
eolivelli commented on pull request #9131:
URL: https://github.com/apache/pulsar/pull/9131#issuecomment-756602944


   /pulsarbot run-failure-checks


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



[GitHub] [pulsar] sijie commented on pull request #9131: Issue 9130: Pulsar-admin sinks create: bad error message "java.lang.NullPointerException: path is 'null'." in case of missing "--name" parameter

Posted by GitBox <gi...@apache.org>.
sijie commented on pull request #9131:
URL: https://github.com/apache/pulsar/pull/9131#issuecomment-757613624


   @eolivelli Can you rebase to the latest master?


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



[GitHub] [pulsar] eolivelli commented on pull request #9131: Issue 9130: Pulsar-admin sinks create: bad error message "java.lang.NullPointerException: path is 'null'." in case of missing "--name" parameter

Posted by GitBox <gi...@apache.org>.
eolivelli commented on pull request #9131:
URL: https://github.com/apache/pulsar/pull/9131#issuecomment-757995039


   /pulsarbot run-failure-checks


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



[GitHub] [pulsar] sijie merged pull request #9131: Issue 9130: Pulsar-admin sinks create: bad error message "java.lang.NullPointerException: path is 'null'." in case of missing "--name" parameter

Posted by GitBox <gi...@apache.org>.
sijie merged pull request #9131:
URL: https://github.com/apache/pulsar/pull/9131


   


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



[GitHub] [pulsar] eolivelli commented on pull request #9131: Issue 9130: Pulsar-admin sinks create: bad error message "java.lang.NullPointerException: path is 'null'." in case of missing "--name" parameter

Posted by GitBox <gi...@apache.org>.
eolivelli commented on pull request #9131:
URL: https://github.com/apache/pulsar/pull/9131#issuecomment-756190690


   /pulsarbot run-failure-checks


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



[GitHub] [pulsar] sijie commented on a change in pull request #9131: Issue 9130: Pulsar-admin sinks create: bad error message "java.lang.NullPointerException: path is 'null'." in case of missing "--name" parameter

Posted by GitBox <gi...@apache.org>.
sijie commented on a change in pull request #9131:
URL: https://github.com/apache/pulsar/pull/9131#discussion_r552160130



##########
File path: pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinksImpl.java
##########
@@ -232,6 +233,10 @@ public void createSink(SinkConfig sinkConfig, String fileName) throws PulsarAdmi
     @Override
     public CompletableFuture<Void> createSinkAsync(SinkConfig sinkConfig, String fileName) {
         final CompletableFuture<Void> future = new CompletableFuture<>();
+        if (StringUtils.isBlank(sinkConfig.getName())) {

Review comment:
       Don't we need a better story here to validate the parameters? For example, what if tenant or namespace is null?




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



[GitHub] [pulsar] eolivelli commented on pull request #9131: Issue 9130: Pulsar-admin sinks create: bad error message "java.lang.NullPointerException: path is 'null'." in case of missing "--name" parameter

Posted by GitBox <gi...@apache.org>.
eolivelli commented on pull request #9131:
URL: https://github.com/apache/pulsar/pull/9131#issuecomment-757744755


   /pulsarbot run-failure-checks


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