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 2020/07/19 17:50:22 UTC

[GitHub] [pulsar] lbenc135 opened a new pull request #7600: [Issue 3127][python-client] Replace Exceptions with PulsarExceptions

lbenc135 opened a new pull request #7600:
URL: https://github.com/apache/pulsar/pull/7600


   <!--
   ### Contribution Checklist
     
     - Name the pull request in the form "[Issue XYZ][component] Title of the pull request", where *XYZ* should be replaced by the actual issue number.
       Skip *Issue XYZ* if there is no associated github issue for this pull request.
       Skip *component* if you are unsure about which is the best component. E.g. `[docs] Fix typo in produce method`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   Fixes #3127 
   
   
   ### Motivation
   
   As the issue says, the Python client throws `Exception`s instead of a subclass of it (`PulsarException`), so the clients must catch the blanket Exception.
   
   ### Modifications
   
   Every C `PulsarException` is now thrown in Python with the same type.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change added tests and can be verified as follows:
   - Extended Python tests to check for PulsarExceptions
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API: no
     - The schema: no
     - The default values of configurations: no
     - The wire protocol: no
     - The rest endpoints: no
     - The admin cli options: no
     - Anything that affects deployment: don't know
   
   ### Documentation
   
     - Does this pull request introduce a new feature? no
   


----------------------------------------------------------------
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] lbenc135 commented on pull request #7600: [Issue 3127][python-client] Replace Exceptions with PulsarExceptions

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


   @n0nvme @aahmed-se I rebased and improved the PR a bit. Some tests are failing, although they seem flaky to me. Let me know if you have any comments.


-- 
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] tuteng commented on pull request #7600: [Issue 3127][python-client] Replace Exceptions with PulsarExceptions

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


   /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] n0nvme commented on pull request #7600: [Issue 3127][python-client] Replace Exceptions with PulsarExceptions

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


   Is it possible to re-run all tests? Logs have expired and it's impossible to see what failed:(


-- 
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] lbenc135 commented on pull request #7600: [Issue 3127][python-client] Replace Exceptions with PulsarExceptions

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


   Hi @sijie @merlimat, could you please take a look?


----------------------------------------------------------------
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] tuteng commented on pull request #7600: [Issue 3127][python-client] Replace Exceptions with PulsarExceptions

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


   @BewareMyPower 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] BewareMyPower commented on pull request #7600: [Issue 3127][python-client] Replace Exceptions with PulsarExceptions

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


   @merlimat @tuteng @jiazhai Could we merge this PR currently?


-- 
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] lbenc135 commented on a change in pull request #7600: [Issue 3127][python-client] Replace Exceptions with PulsarExceptions

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



##########
File path: pulsar-client-cpp/python/pulsar_test.py
##########
@@ -147,11 +159,8 @@ def test_producer_consumer(self):
         self.assertTrue(msg)
         self.assertEqual(msg.data(), b'hello')
 
-        try:
-            msg = consumer.receive(100)
-            self.assertTrue(False)  # Should not reach this point
-        except:
-            pass  # Exception is expected
+        with self.assertRaises(PulsarException):

Review comment:
       Yes, refactored




-- 
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] codelipenghui merged pull request #7600: [Issue 3127][python-client] Replace Exceptions with PulsarExceptions

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


   


-- 
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 #7600: [Issue 3127][python-client] Replace Exceptions with PulsarExceptions

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



##########
File path: pulsar-client-cpp/python/pulsar_test.py
##########
@@ -147,11 +159,8 @@ def test_producer_consumer(self):
         self.assertTrue(msg)
         self.assertEqual(msg.data(), b'hello')
 
-        try:
-            msg = consumer.receive(100)
-            self.assertTrue(False)  # Should not reach this point
-        except:
-            pass  # Exception is expected
+        with self.assertRaises(PulsarException):

Review comment:
       In these tests, could we assert for `pulsar.Timeout` exception?




-- 
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] aahmed-se commented on pull request #7600: [Issue 3127][python-client] Replace Exceptions with PulsarExceptions

Posted by GitBox <gi...@apache.org>.
aahmed-se commented on pull request #7600:
URL: https://github.com/apache/pulsar/pull/7600#issuecomment-805559844


   @n0nvme rebase and resolve all conflicts first , then push those changes the tests will rerun.


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