-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[fix][admin]Backlog quota's policy is null which causes a NPE #24192
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
base: master
Are you sure you want to change the base?
Conversation
/pulsarbot rerun-failure-checks |
checkstyle failed |
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.
The test org.apache.pulsar.broker.admin.AdminApiTest.testRetentionAndBacklogQuotaCheck
fails.
admin.namespaces().setBacklogQuota(ns.toString(), BacklogQuota.builder().limitTime(1).limitSize(1).retentionPolicy( | ||
BacklogQuota.RetentionPolicy.consumer_backlog_eviction).build()); | ||
BacklogQuota backlogQuotaWithNonPolicy = BacklogQuota.builder().limitTime(1).limitSize(1).build(); | ||
JerseyClient httpClient = JerseyClientBuilder.createClient(); |
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 leaks resources in the test. The .close()
method of the JerseyClient
instance should be called. Adding a Lombok @Cleanup
annotation would handle it.
Motivation
pulsar-admin namespaces set-backlog-quota <namespace>
does not allow a null attributepolicy
, but HTTP APIPOST /admin/v2/namespaces/{namespace}/backlogQuota
allows.pulsar-admin topicPolicies set-backlog-quota <namespace>
does not allow a null attributepolicy
, but HTTP APIPOST /admin/v2/namespaces/{topic}/backlogQuota
allows.It leads a NPE
Modifications
Let HTTP API does not allow the null
policy
as wellDocumentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: x