提交 4f55878d 编写于 作者: R Rajan Dhabalia 提交者: xiaolong.ran

[pulsar-proxy] add debug log + fix thread-factory name (#5302)

### Motivation
We are debugging issue where client is timing out lookup request and it helps to have debug log for successful lookup response. and fix thread-factory name for proxy.

(cherry picked from commit ab8db2d4)
上级 5c614d80
......@@ -27,7 +27,6 @@ import java.net.URISyntaxException;
import java.util.Optional;
import org.apache.commons.lang3.StringUtils;
import org.apache.pulsar.common.api.proto.PulsarApi.CommandGetSchemaResponse;
import org.apache.pulsar.common.protocol.Commands;
import org.apache.pulsar.common.api.proto.PulsarApi.CommandGetTopicsOfNamespace;
import org.apache.pulsar.common.api.proto.PulsarApi.CommandGetSchema;
......@@ -37,7 +36,6 @@ import org.apache.pulsar.common.api.proto.PulsarApi.CommandPartitionedTopicMetad
import org.apache.pulsar.common.api.proto.PulsarApi.ServerError;
import org.apache.pulsar.common.naming.TopicName;
import org.apache.pulsar.common.protocol.schema.BytesSchemaVersion;
import org.apache.pulsar.common.schema.SchemaInfo;
import org.apache.pulsar.policies.data.loadbalancer.ServiceLookupData;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -172,6 +170,11 @@ public class LookupProxyHandler {
// client
// to use the appropriate target broker (and port) when it
// will connect back.
if (log.isDebugEnabled()) {
log.debug(
"Successfully perform lookup '{}' for topic '{}' with clientReq Id '{}' and lookup-broker {}",
addr, topic, clientRequestId, brokerUrl);
}
proxyConnection.ctx().writeAndFlush(Commands.newLookupResponse(brokerUrl, brokerUrl, true,
LookupType.Connect, clientRequestId, true /* this is coming from proxy */));
}
......
......@@ -63,8 +63,8 @@ public class ProxyService implements Closeable {
private final EventLoopGroup acceptorGroup;
private final EventLoopGroup workerGroup;
private final DefaultThreadFactory acceptorThreadFactory = new DefaultThreadFactory("pulsar-discovery-acceptor");
private final DefaultThreadFactory workersThreadFactory = new DefaultThreadFactory("pulsar-discovery-io");
private final DefaultThreadFactory acceptorThreadFactory = new DefaultThreadFactory("pulsar-proxy-acceptor");
private final DefaultThreadFactory workersThreadFactory = new DefaultThreadFactory("pulsar-proxy-io");
private BrokerDiscoveryProvider discoveryProvider;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册