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/04/05 12:12:54 UTC

[GitHub] [pulsar] linlinnn opened a new pull request #10139: [ISSUE 10138] fix npe when new transaction

linlinnn opened a new pull request #10139:
URL: https://github.com/apache/pulsar/pull/10139


   Fixes #10138
   
   ### Modifications
   If disable transaction, throw PulsarClientException when new transaction
   
   ### Verifying this change
   Add unit test


-- 
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] merlimat merged pull request #10139: [ISSUE 10138] fix npe when new transaction

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


   


-- 
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] merlimat commented on a change in pull request #10139: [ISSUE 10138] fix npe when new transaction

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



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java
##########
@@ -931,7 +931,10 @@ public ExecutorService getInternalExecutorService() {
     // This method should be exposed in the PulsarClient interface. Only expose it when all the transaction features
     // are completed.
     // @Override
-    public TransactionBuilder newTransaction() {
+    public TransactionBuilder newTransaction() throws PulsarClientException {
+        if (!conf.isEnableTransaction()) {
+            throw new PulsarClientException.InvalidConfigurationException("Disable Transaction");

Review comment:
       ```suggestion
               throw new PulsarClientException.InvalidConfigurationException("Transactions are not enabled");
   ```
   ```suggestion
               throw new PulsarClientException.InvalidConfigurationException("Disable Transaction");
   ```

##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/PulsarClient.java
##########
@@ -312,7 +312,9 @@ static ClientBuilder builder() {
      * @return a {@link TransactionBuilder} object to configure and construct
      * the {@link org.apache.pulsar.client.api.transaction.Transaction} instance
      *
+     * @throws PulsarClientException
+     *             if disable transaction

Review comment:
       ```suggestion
        *             if transactions are not enabled
   ```
   ```suggestion
        *             if disable transaction
   ```




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