315157973 opened a new pull request #8234: URL: https://github.com/apache/pulsar/pull/8234
### Motivation When we use `SystemTopicBasedTopicPoliciesService#updateTopicPoliciesAsync` to update Topic-level policies, `Listener.onUpdate()` will be triggered; Now this approach will cause 2 problems: 1) Because `updateTopicPoliciesAsync` only sends the message to the system topic, it has not been consumed yet. Therefore, the policy data in the cache is still old. When listeners are triggered, they cannot get the policies directly through the cache. They have to modify the existing interface and pass the policies through parameters. 2) When the broker restarts, some topic-level policies will no longer take effect, because they rely on the `onUpdate` method to take effect ### Modifications 1)The trigger occasion of `listener.onUpdate` is changed to when the reader consumes the event 2)fix some npe ### Verifying this change TopicPoliciesTest#testRestart ---------------------------------------------------------------- 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: [email protected]
