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 2022/03/14 11:33:16 UTC

[GitHub] [pulsar] alanhowells commented on a change in pull request #11633: Sync up C error code with C++

alanhowells commented on a change in pull request #11633:
URL: https://github.com/apache/pulsar/pull/11633#discussion_r825847815



##########
File path: pulsar-client-cpp/include/pulsar/c/result.h
##########
@@ -53,14 +53,15 @@ typedef enum {
 
     pulsar_result_ConsumerNotInitialized,         /// Consumer is not initialized
     pulsar_result_ProducerNotInitialized,         /// Producer is not initialized
+    pulsar_result_ProducerBusy,                   /// Producer with same name is already connected

Review comment:
       I am sorry, but this breaks the C API.
   
   You cannot change C error code values (like you cannot change C function prototypes, only add to them).
   
   E.g. If client code checks against pulsar_result_InvalidTopicName, and the underlying pulsar.so gets upgraded, the client code using this check will now be unknowingly checking against pulsar_result_TooManyLookupRequestException (since the value of the result code has changed).
   
   This is fundamental to C coding, you cannot change existing values.
   
   With this change, you have broken all C clients that check for specific result codes from pulsar_result_TooManyLookupRequestException downwards.




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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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