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/15 04:47:43 UTC

[GitHub] [pulsar] codelipenghui commented on a change in pull request #14684: Enhance fault tolerance when set ``autoTopicCreation ``

codelipenghui commented on a change in pull request #14684:
URL: https://github.com/apache/pulsar/pull/14684#discussion_r826577183



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
##########
@@ -831,8 +831,11 @@ protected void internalSetAutoTopicCreation(AsyncResponse asyncResponse,
         validatePoliciesReadOnlyAccess();
         if (autoTopicCreationOverride != null) {
             if (!AutoTopicCreationOverrideImpl.isValidOverride(autoTopicCreationOverride)) {
-                throw new RestException(Status.PRECONDITION_FAILED,
-                        "Invalid configuration for autoTopicCreationOverride");
+                // To enhance error tolerance, automatic error correction
+                if (!autoTopicCreationOverride.autoFix()) {
+                    throw new RestException(Status.PRECONDITION_FAILED,
+                            "Invalid configuration for autoTopicCreationOverride");
+                }

Review comment:
       I think we should provide an accurate error message, not introduce auto-fix here. It will make the API more clear and straightforward




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