lhotari commented on code in PR #24395: URL: https://github.com/apache/pulsar/pull/24395#discussion_r2134642217
########## pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java: ########## @@ -2531,17 +2531,30 @@ protected void handleGetTopicsOfNamespace(CommandGetTopicsOfNamespace commandGet "[{}] Received CommandGetTopicsOfNamespace for namespace [//{}] by {}, size:{}", remoteAddress, namespace, requestId, topics.size()); } - commandSender.sendGetTopicsOfNamespaceResponse(filteredTopics, hash, filterTopics, - !hashUnchanged, requestId); + if (ctx.channel().isWritable()) { + commandSender.sendGetTopicsOfNamespaceResponse(filteredTopics, hash, filterTopics, + !hashUnchanged, requestId); + } else { + /* + To avoid direct OutOfMemoryError (OOM), we should refrain from appending a large + volume of topic lists to the Netty ChannelOutboundBuffer's pending queue when the + channel is in an unwritable state. Review Comment: How large is the data volume that is sent out? Does this solution really help in addressing the problem? The same channel might be used for other purposes at the same time, for sending messages to consumers and the channel might not be writable even after retries. -- 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-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org