massakam opened a new pull request #4064: [client] Set actual topic name to partitioned consumer URL: https://github.com/apache/pulsar/pull/4064 ### Motivation When I got "proxy stats" from our WebSocket proxy, it contained a large number of entries as follows: ```sh $ curl -s http://dev-websocket20.pulsar.xxx.yahoo.co.jp:4080/admin/v2/proxy-stats/stats | jq . { "TopicsConsumerFakeTopicNamec7f8a": { "producerStats": [], "consumerStats": [] }, "TopicsConsumerFakeTopicName68c2f": { "producerStats": [], "consumerStats": [] }, "TopicsConsumerFakeTopicName4401e": { "producerStats": [], "consumerStats": [] }, "TopicsConsumerFakeTopicName0fedd": { "producerStats": [], "consumerStats": [] }, "TopicsConsumerFakeTopicName1c581": { "producerStats": [], "consumerStats": [] }, ... ``` `TopicsConsumerFakeTopicName*` is a dummy topic name that is set when an instance of `MultiTopicsConsumerImpl` is created. https://github.com/apache/pulsar/blob/bdfc09867325a271dc40a3aa87dcefb905769f06/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java#L97-L100 This topic name changes every time a new consumer is created, even if the consumer is for the same topic. This means that the memory usage of WebSocket proxy will increase endlessly. ### Modifications `MultiTopicsConsumerImpl` is used in the following three cases: - (A) When subscribing to a partitioned topic - (B) When subscribing to multiple topics by specifying a list - (C) When subscribing to multiple topics by specifying a pattern Of these, the cause of memory leak in WebSocket proxy is (A). So, only in the case of (A), set the actual topic name to `MultiTopicsConsumerImpl`. ### Verifying this change - [ ] Make sure that the change passes the CI checks.
---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services