-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[broker] Make resetting cursor in REST API asynchronous #7744
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
cbf7194
to
5fe7e5f
Compare
@@ -232,7 +232,6 @@ public void testTerminatePartitionedTopic() { | |||
|
|||
@Test | |||
public void testNonPartitionedTopics() { | |||
pulsar.getConfiguration().setAllowAutoTopicCreation(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test fails if allowAutoTopicCreation
is false.
We are testing if the subscription creation is successful here. However, if allowAutoTopicCreation
is false, the topic cannot be created and the subscription creation should also fail.
pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Lines 1787 to 1789 in 8061c54
boolean isAllowAutoTopicCreation = pulsar().getConfiguration().isAllowAutoTopicCreation(); | |
PersistentTopic topic = (PersistentTopic) pulsar().getBrokerService() | |
.getTopic(topicName.toString(), isAllowAutoTopicCreation).thenApply(Optional::get).join(); |
I think it's a mistake to set allowAutoTopicCreation
to false here. Previously this test passed because the REST API was not able to return the error response correctly.
### Motivation As mentioned in apache#7478, `PersistentSubscription#resetCursor()` may not complete for unknown reasons. This blocks `pulsar-web` threads, so it can cause the broker server to be unable to respond to HTTP requests. ### Modifications Get the result of `PersistentSubscription#resetCursor()` asynchronously so as not to block `pulsar-web` threads.
### Motivation As mentioned in apache#7478, `PersistentSubscription#resetCursor()` may not complete for unknown reasons. This blocks `pulsar-web` threads, so it can cause the broker server to be unable to respond to HTTP requests. ### Modifications Get the result of `PersistentSubscription#resetCursor()` asynchronously so as not to block `pulsar-web` threads.
### Motivation As mentioned in apache#7478, `PersistentSubscription#resetCursor()` may not complete for unknown reasons. This blocks `pulsar-web` threads, so it can cause the broker server to be unable to respond to HTTP requests. ### Modifications Get the result of `PersistentSubscription#resetCursor()` asynchronously so as not to block `pulsar-web` threads.
### Motivation As mentioned in apache#7478, `PersistentSubscription#resetCursor()` may not complete for unknown reasons. This blocks `pulsar-web` threads, so it can cause the broker server to be unable to respond to HTTP requests. ### Modifications Get the result of `PersistentSubscription#resetCursor()` asynchronously so as not to block `pulsar-web` threads.
Motivation
As mentioned in #7478,
PersistentSubscription#resetCursor()
may not complete for unknown reasons. This blockspulsar-web
threads, so it can cause the broker server to be unable to respond to HTTP requests.Modifications
Get the result of
PersistentSubscription#resetCursor()
asynchronously so as not to blockpulsar-web
threads.