nodece opened a new pull request, #17831:
URL: https://github.com/apache/pulsar/pull/17831

   Fixes https://github.com/apache/pulsar/issues/10816
   
   ### Motivation
   
   The proxy client cannot refresh the original authentication data 
immediately. The user(original) client still works, but there will be network 
disconnection.
   
   New version:
   ```
   2022-09-23T11:18:36,607 - INFO  - [pulsar-proxy-io-38-2:ProxyConnection@341] 
- [/127.0.0.1:51556] complete connection, init proxy handler. authenticated 
with token role client, hasProxyToBrokerUrl: false
   2022-09-23T11:18:36,615 - INFO  - [pulsar-proxy-io-38-5:ConnectionPool@245] 
- [[id: 0x3e7cc63b, L:/127.0.0.1:51557 - R:localhost/127.0.0.1:51549]] 
Connected to server
   2022-09-23T11:18:36,635 - INFO  - [pulsar-io-6-1:ServerCnx@299] - New 
connection from /127.0.0.1:51557
   2022-09-23T11:18:36,691 - INFO  - 
[pulsar-client-io-40-1:ProducerStatsRecorderImpl@106] - Starting Pulsar 
producer perf with config: 
{"topicName":"persistent://my-tenant/my-ns/my-topic1","producerName":null,"sendTimeoutMs":30000,"blockIfQueueFull":false,"maxPendingMessages":0,"maxPendingMessagesAcrossPartitions":0,"messageRoutingMode":"RoundRobinPartition","hashingScheme":"JavaStringHash","cryptoFailureAction":"FAIL","batchingMaxPublishDelayMicros":1000,"batchingPartitionSwitchFrequencyByPublishDelay":10,"batchingMaxMessages":1000,"batchingMaxBytes":131072,"batchingEnabled":true,"chunkingEnabled":false,"chunkMaxMessageSize":-1,"compressionType":"NONE","initialSequenceId":null,"autoUpdatePartitions":true,"autoUpdatePartitionsIntervalSeconds":60,"multiSchema":true,"accessMode":"Shared","lazyStartPartitionedProducers":false,"properties":{},"initialSubscriptionName":null}
   2022-09-23T11:18:36,693 - INFO  - 
[pulsar-client-io-40-1:ProducerStatsRecorderImpl@107] - Pulsar client config: 
{"serviceUrl":"pulsar://localhost:51554/","authPluginClassName":null,"authParams":null,"authParamMap":null,"operationTimeoutMs":3000,"lookupTimeoutMs":3000,"statsIntervalSeconds":60,"numIoThreads":1,"numListenerThreads":1,"connectionsPerBroker":1,"connectionMaxIdleSeconds":180,"useTcpNoDelay":true,"useTls":false,"tlsKeyFilePath":null,"tlsCertificateFilePath":null,"tlsTrustCertsFilePath":null,"tlsAllowInsecureConnection":false,"tlsHostnameVerificationEnable":false,"concurrentLookupRequest":5000,"maxLookupRequest":50000,"maxLookupRedirects":20,"maxNumberOfRejectedRequestPerConnection":50,"keepAliveIntervalSeconds":30,"connectionTimeoutMs":10000,"requestTimeoutMs":60000,"initialBackoffIntervalNanos":100000000,"maxBackoffIntervalNanos":60000000000,"enableBusyWait":false,"listenerName":null,"useKeyStoreTls":false,"sslProvider":null,"tlsKeyStoreType":"JKS","tlsKeyStorePath":nu
 
ll,"tlsKeyStorePassword":null,"tlsTrustStoreType":"JKS","tlsTrustStorePath":null,"tlsTrustStorePassword":null,"tlsCiphers":[],"tlsProtocols":[],"memoryLimitBytes":67108864,"proxyServiceUrl":null,"proxyProtocol":null,"enableTransaction":false,"dnsLookupBindAddress":null,"dnsLookupBindPort":0,"socks5ProxyAddress":null,"socks5ProxyUsername":null,"socks5ProxyPassword":null}
   2022-09-23T11:18:36,710 - INFO  - 
[metadata-store-12-1:NamespaceBundleFactory@186] - Policy updated for namespace 
Optional[my-tenant/my-ns], refreshing the bundle cache.
   2022-09-23T11:18:36,738 - INFO  - [pulsar-4-1:ModularLoadManagerImpl@857] - 
1 brokers being considered for assignment of 
my-tenant/my-ns/0x00000000_0xffffffff
   2022-09-23T11:18:36,740 - INFO  - [pulsar-4-1:OwnershipCache@199] - Trying 
to acquire ownership of my-tenant/my-ns/0x00000000_0xffffffff
   2022-09-23T11:18:36,742 - INFO  - [metadata-store-12-1:ResourceLockImpl@166] 
- Acquired resource lock on /namespace/my-tenant/my-ns/0x00000000_0xffffffff
   2022-09-23T11:18:36,742 - INFO  - [metadata-store-12-1:OwnershipCache@205] - 
Successfully acquired ownership of 
OwnedBundle(bundle=my-tenant/my-ns/0x00000000_0xffffffff, isActive=1)
   2022-09-23T11:18:36,743 - INFO  - [pulsar-4-2:PulsarService@1187] - Loading 
all topics on bundle: my-tenant/my-ns/0x00000000_0xffffffff
   2022-09-23T11:18:36,750 - INFO  - [pulsar-client-io-40-1:ConnectionPool@245] 
- [[id: 0x399d1371, L:/127.0.0.1:51558 - R:localhost/127.0.0.1:51554]] 
Connected to server
   2022-09-23T11:18:36,750 - INFO  - [pulsar-client-io-40-1:ClientCnx@255] - 
[id: 0x399d1371, L:/127.0.0.1:51558 - R:localhost/127.0.0.1:51554] Connected 
through proxy to target broker at localhost:51549
   2022-09-23T11:18:36,751 - INFO  - [pulsar-proxy-io-38-7:ProxyConnection@186] 
- [/127.0.0.1:51558] New connection opened
   2022-09-23T11:18:36,762 - INFO  - [pulsar-proxy-io-38-7:ProxyConnection@341] 
- [/127.0.0.1:51558] complete connection, init proxy handler. authenticated 
with token role client, hasProxyToBrokerUrl: true
   2022-09-23T11:18:36,770 - INFO  - [pulsar-io-6-2:ServerCnx@299] - New 
connection from /127.0.0.1:51559
   2022-09-23T11:18:36,776 - INFO  - [pulsar-client-io-40-1:ProducerImpl@1639] 
- [persistent://my-tenant/my-ns/my-topic1] [null] Creating producer on cnx [id: 
0x399d1371, L:/127.0.0.1:51558 - R:localhost/127.0.0.1:51554]
   2022-09-23T11:18:36,836 - INFO  - [pulsar-io-6-2:ManagedLedgerImpl@356] - 
Opening managed ledger my-tenant/my-ns/persistent/my-topic1
   2022-09-23T11:18:36,841 - INFO  - 
[bookkeeper-ml-scheduler-OrderedScheduler-4-0:MetaStoreImpl@113] - Creating 
'/managed-ledgers/my-tenant/my-ns/persistent/my-topic1'
   2022-09-23T11:18:36,882 - INFO  - 
[mock-pulsar-bk-OrderedExecutor-0-0:PulsarMockBookKeeper@122] - Creating ledger 
3
   2022-09-23T11:18:36,914 - INFO  - 
[mock-pulsar-bk-OrderedExecutor-0-0:ManagedLedgerImpl@505] - 
[my-tenant/my-ns/persistent/my-topic1] Created ledger 3
   2022-09-23T11:18:36,942 - INFO  - 
[bookkeeper-ml-scheduler-OrderedScheduler-4-0:ManagedLedgerFactoryImpl$2@380] - 
[my-tenant/my-ns/persistent/my-topic1] Successfully initialize managed ledger
   2022-09-23T11:18:36,984 - INFO  - 
[bookkeeper-ml-scheduler-OrderedScheduler-4-0:BrokerService$2@1502] - Created 
topic persistent://my-tenant/my-ns/my-topic1 - dedup is disabled
   2022-09-23T11:18:37,000 - INFO  - 
[bookkeeper-ml-scheduler-OrderedScheduler-4-0:ServerCnx@1474] - 
[/127.0.0.1:51559] Created new producer: 
Producer{topic=PersistentTopic{topic=persistent://my-tenant/my-ns/my-topic1}, 
client=/127.0.0.1:51559, producerName=proxy-authorization-0-0, producerId=0}
   2022-09-23T11:18:37,006 - INFO  - [pulsar-client-io-40-1:ProducerImpl@1694] 
- [persistent://my-tenant/my-ns/my-topic1] [proxy-authorization-0-0] Created 
producer on cnx [id: 0x399d1371, L:/127.0.0.1:51558 - 
R:localhost/127.0.0.1:51554]
   2022-09-23T11:18:47,999 - INFO  - [pulsar-io-6-2:ServerCnx@769] - 
[/127.0.0.1:51559] Refreshing authentication credentials for originalPrincipal 
client and authRole Proxy
   2022-09-23T11:18:47,999 - INFO  - [pulsar-io-6-1:ServerCnx@769] - 
[/127.0.0.1:51557] Refreshing authentication credentials for originalPrincipal 
client and authRole Proxy
   2022-09-23T11:18:48,008 - INFO  - [pulsar-io-6-2:ServerCnx@730] - 
[/127.0.0.1:51559] Refreshed authentication credentials for role client
   2022-09-23T11:18:48,010 - INFO  - [pulsar-io-6-1:ServerCnx@730] - 
[/127.0.0.1:51557] Refreshed authentication credentials for role client
   ```
   Old version:
   ```
   2022-09-23T11:17:45,889 - INFO  - [pulsar-client-io-40-1:ConnectionPool@245] 
- [[id: 0x155081f5, L:/127.0.0.1:51513 - R:localhost/127.0.0.1:51508]] 
Connected to server
   2022-09-23T11:17:45,890 - INFO  - [pulsar-client-io-40-1:ClientCnx@255] - 
[id: 0x155081f5, L:/127.0.0.1:51513 - R:localhost/127.0.0.1:51508] Connected 
through proxy to target broker at localhost:51503
   2022-09-23T11:17:45,891 - INFO  - [pulsar-proxy-io-38-7:ProxyConnection@186] 
- [/127.0.0.1:51513] New connection opened
   2022-09-23T11:17:45,902 - INFO  - [pulsar-proxy-io-38-7:ProxyConnection@341] 
- [/127.0.0.1:51513] complete connection, init proxy handler. authenticated 
with token role client, hasProxyToBrokerUrl: true
   2022-09-23T11:17:45,911 - INFO  - [pulsar-io-6-2:ServerCnx@299] - New 
connection from /127.0.0.1:51514
   2022-09-23T11:17:45,917 - INFO  - [pulsar-client-io-40-1:ProducerImpl@1639] 
- [persistent://my-tenant/my-ns/my-topic1] [null] Creating producer on cnx [id: 
0x155081f5, L:/127.0.0.1:51513 - R:localhost/127.0.0.1:51508]
   2022-09-23T11:17:45,993 - INFO  - [pulsar-io-6-2:ManagedLedgerImpl@356] - 
Opening managed ledger my-tenant/my-ns/persistent/my-topic1
   2022-09-23T11:17:45,996 - INFO  - 
[bookkeeper-ml-scheduler-OrderedScheduler-4-0:MetaStoreImpl@113] - Creating 
'/managed-ledgers/my-tenant/my-ns/persistent/my-topic1'
   2022-09-23T11:17:46,038 - INFO  - 
[mock-pulsar-bk-OrderedExecutor-0-0:PulsarMockBookKeeper@122] - Creating ledger 
3
   2022-09-23T11:17:46,077 - INFO  - 
[mock-pulsar-bk-OrderedExecutor-0-0:ManagedLedgerImpl@505] - 
[my-tenant/my-ns/persistent/my-topic1] Created ledger 3
   2022-09-23T11:17:46,111 - INFO  - 
[bookkeeper-ml-scheduler-OrderedScheduler-4-0:ManagedLedgerFactoryImpl$2@380] - 
[my-tenant/my-ns/persistent/my-topic1] Successfully initialize managed ledger
   2022-09-23T11:17:46,160 - INFO  - 
[bookkeeper-ml-scheduler-OrderedScheduler-4-0:BrokerService$2@1502] - Created 
topic persistent://my-tenant/my-ns/my-topic1 - dedup is disabled
   2022-09-23T11:17:46,177 - INFO  - 
[bookkeeper-ml-scheduler-OrderedScheduler-4-0:ServerCnx@1474] - 
[/127.0.0.1:51514] Created new producer: 
Producer{topic=PersistentTopic{topic=persistent://my-tenant/my-ns/my-topic1}, 
client=/127.0.0.1:51514, producerName=proxy-authorization-0-0, producerId=0}
   2022-09-23T11:17:46,183 - INFO  - [pulsar-client-io-40-1:ProducerImpl@1694] 
- [persistent://my-tenant/my-ns/my-topic1] [proxy-authorization-0-0] Created 
producer on cnx [id: 0x155081f5, L:/127.0.0.1:51513 - 
R:localhost/127.0.0.1:51508]
   2022-09-23T11:17:56,653 - INFO  - [pulsar-io-6-1:ServerCnx@769] - 
[/127.0.0.1:51511] Refreshing authentication credentials for originalPrincipal 
client and authRole Proxy
   2022-09-23T11:17:56,653 - INFO  - [pulsar-io-6-2:ServerCnx@769] - 
[/127.0.0.1:51514] Refreshing authentication credentials for originalPrincipal 
client and authRole Proxy
   2022-09-23T11:17:56,660 - WARN  - [pulsar-io-6-1:ServerCnx@726] - 
[/127.0.0.1:51511] Principal cannot change during an authentication refresh 
expected=client got=Proxy
   2022-09-23T11:17:56,661 - INFO  - [pulsar-io-6-2:ServerCnx@730] - 
[/127.0.0.1:51514] Refreshed authentication credentials for role client
   2022-09-23T11:17:56,661 - INFO  - [pulsar-io-6-1:ServerCnx@311] - Closed 
connection from /127.0.0.1:51511
   2022-09-23T11:17:56,661 - INFO  - [pulsar-proxy-io-38-5:ClientCnx@292] - 
[id: 0x23766f8b, L:/127.0.0.1:51511 ! R:localhost/127.0.0.1:51503] Disconnected
   2022-09-23T11:18:02,580 - INFO  - [pulsar-proxy-io-38-10:ConnectionPool@245] 
- [[id: 0xe8cbf738, L:/127.0.0.1:51523 - R:localhost/127.0.0.1:51503]] 
Connected to server
   2022-09-23T11:18:02,582 - INFO  - [pulsar-io-6-4:ServerCnx@299] - New 
connection from /127.0.0.1:51523
   2022-09-23T11:18:02,588 - INFO  - [pulsar-io-6-4:ServerCnx@3082] - 
[/127.0.0.1:51523] Failed to authenticate: operation=connect, principal=Proxy, 
reason=Failed to authentication token: JWT expired at 2022-09-23T03:17:55Z. 
Current time: 2022-09-23T03:18:02Z, a difference of 7586 milliseconds.  Allowed 
clock skew: 0 milliseconds.
   2022-09-23T11:18:02,590 - INFO  - [pulsar-io-6-4:ServerCnx@311] - Closed 
connection from /127.0.0.1:51523
   2022-09-23T11:18:02,590 - WARN  - [pulsar-proxy-io-38-10:ClientCnx@732] - 
[id: 0xe8cbf738, L:/127.0.0.1:51523 - R:localhost/127.0.0.1:51503] Received 
error from server: Unable to authenticate
   2022-09-23T11:18:02,590 - WARN  - [pulsar-proxy-io-38-10:ConnectionPool@282] 
- [[id: 0xe8cbf738, L:/127.0.0.1:51523 - R:localhost/127.0.0.1:51503]] 
Connection handshake failed: 
org.apache.pulsar.client.api.PulsarClientException$AuthenticationException: 
Unable to authenticate
   2022-09-23T11:18:02,591 - ERROR - [pulsar-client-io-40-1:ClientCnx@1138] - 
[id: 0xb8d2d6d6, L:/127.0.0.1:51510 - R:localhost/127.0.0.1:51508] Close 
connection because received internal-server error 
{"errorMsg":"org.apache.pulsar.client.api.PulsarClientException$AuthenticationException:
 Unable to authenticate","reqId":676244056976135601, 
"remote":"localhost/127.0.0.1:51508", "local":"/127.0.0.1:51510"}
   2022-09-23T11:18:02,591 - ERROR - [pulsar-proxy-io-38-10:ClientCnx@741] - 
[id: 0xe8cbf738, L:/127.0.0.1:51523 ! R:localhost/127.0.0.1:51503] Failed to 
authenticate the client
   2022-09-23T11:18:02,591 - WARN  - [pulsar-proxy-io-38-10:ClientCnx@753] - 
[id: 0xe8cbf738, L:/127.0.0.1:51523 ! R:localhost/127.0.0.1:51503] Received 
unknown request id from server: -1
   2022-09-23T11:18:02,592 - INFO  - [pulsar-proxy-io-38-10:ClientCnx@292] - 
[id: 0xe8cbf738, L:/127.0.0.1:51523 ! R:localhost/127.0.0.1:51503] Disconnected
   2022-09-23T11:18:02,592 - INFO  - [pulsar-proxy-io-38-2:ProxyConnection@199] 
- [/127.0.0.1:51510] Connection closed
   2022-09-23T11:18:02,592 - WARN  - 
[pulsar-client-io-40-1:BinaryProtoLookupService@198] - 
[persistent://my-tenant/my-ns/my-topic1] failed to get Partitioned metadata : 
{"errorMsg":"org.apache.pulsar.client.api.PulsarClientException$AuthenticationException:
 Unable to authenticate","reqId":676244056976135601, 
"remote":"localhost/127.0.0.1:51508", "local":"/127.0.0.1:51510"}
   org.apache.pulsar.client.api.PulsarClientException$LookupException: 
{"errorMsg":"org.apache.pulsar.client.api.PulsarClientException$AuthenticationException:
 Unable to authenticate","reqId":676244056976135601, 
"remote":"localhost/127.0.0.1:51508", "local":"/127.0.0.1:51510"}
        at 
org.apache.pulsar.client.impl.ClientCnx.getPulsarClientException(ClientCnx.java:1224)
 ~[classes/:?]
        at 
org.apache.pulsar.client.impl.ClientCnx.handlePartitionResponse(ClientCnx.java:640)
 ~[classes/:?]
        at 
org.apache.pulsar.common.protocol.PulsarDecoder.channelRead(PulsarDecoder.java:134)
 ~[classes/:?]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:327)
 ~[netty-codec-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:314)
 ~[netty-codec-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:435)
 ~[netty-codec-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:279)
 ~[netty-codec-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.handler.flush.FlushConsolidationHandler.channelRead(FlushConsolidationHandler.java:152)
 ~[netty-handler-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) 
~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) 
~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) 
~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995)
 ~[netty-common-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
~[netty-common-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
 ~[netty-common-4.1.77.Final.jar:4.1.77.Final]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
   2022-09-23T11:18:02,593 - ERROR - [pulsar-client-io-40-1:ClientCnx@1138] - 
[id: 0xb8d2d6d6, L:/127.0.0.1:51510 ! R:localhost/127.0.0.1:51508] Close 
connection because received internal-server error 
{"errorMsg":"org.apache.pulsar.client.api.PulsarClientException$AuthenticationException:
 Unable to authenticate","reqId":676244056976135600, 
"remote":"localhost/127.0.0.1:51508", "local":"/127.0.0.1:51510"}
   2022-09-23T11:18:02,593 - WARN  - 
[pulsar-client-io-40-1:BinaryProtoLookupService@198] - 
[persistent://my-tenant/my-ns/my-topic1] failed to get Partitioned metadata : 
{"errorMsg":"org.apache.pulsar.client.api.PulsarClientException$AuthenticationException:
 Unable to authenticate","reqId":676244056976135600, 
"remote":"localhost/127.0.0.1:51508", "local":"/127.0.0.1:51510"}
   org.apache.pulsar.client.api.PulsarClientException$LookupException: 
{"errorMsg":"org.apache.pulsar.client.api.PulsarClientException$AuthenticationException:
 Unable to authenticate","reqId":676244056976135600, 
"remote":"localhost/127.0.0.1:51508", "local":"/127.0.0.1:51510"}
        at 
org.apache.pulsar.client.impl.ClientCnx.getPulsarClientException(ClientCnx.java:1224)
 ~[classes/:?]
        at 
org.apache.pulsar.client.impl.ClientCnx.handlePartitionResponse(ClientCnx.java:640)
 ~[classes/:?]
        at 
org.apache.pulsar.common.protocol.PulsarDecoder.channelRead(PulsarDecoder.java:134)
 ~[classes/:?]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:327)
 ~[netty-codec-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:299)
 ~[netty-codec-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.handler.flush.FlushConsolidationHandler.channelRead(FlushConsolidationHandler.java:152)
 ~[netty-handler-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) 
~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) 
~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) 
~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995)
 ~[netty-common-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
~[netty-common-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
 ~[netty-common-4.1.77.Final.jar:4.1.77.Final]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
   2022-09-23T11:18:02,594 - INFO  - [pulsar-client-io-40-1:ClientCnx@292] - 
[id: 0xb8d2d6d6, L:/127.0.0.1:51510 ! R:localhost/127.0.0.1:51508] Disconnected
   2022-09-23T11:18:02,594 - WARN  - 
[pulsar-client-io-40-1:BinaryProtoLookupService@198] - 
[persistent://my-tenant/my-ns/my-topic1] failed to get Partitioned metadata : 
Disconnected from server at localhost/127.0.0.1:51508
   org.apache.pulsar.client.api.PulsarClientException$ConnectException: 
Disconnected from server at localhost/127.0.0.1:51508
        at 
org.apache.pulsar.client.impl.ClientCnx.channelInactive(ClientCnx.java:298) 
~[classes/:?]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:241)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:392)
 ~[netty-codec-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:357)
 ~[netty-codec-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:241)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1405)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:901)
 ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.channel.AbstractChannel$AbstractUnsafe$7.run(AbstractChannel.java:813) 
~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
 ~[netty-common-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
 ~[netty-common-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
 ~[netty-common-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) 
~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995)
 ~[netty-common-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
~[netty-common-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
 ~[netty-common-4.1.77.Final.jar:4.1.77.Final]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
   ````
   ### Modifications
   
   - Improve the ClientCnx and ProxyClientCnx to override method
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc-required` 
   (Your PR needs to update docs and you will update later)
   
   - [x] `doc-not-needed` 
   (Please explain why)
   
   - [ ] `doc` 
   (Your PR contains doc changes)
   
   - [ ] `doc-complete`
   (Docs have been already added)
   
   ### Matching PR in forked repository
   
   PR in forked repository: <!-- ENTER URL HERE 
   
   After opening this PR, the build in apache/pulsar will fail and instructions 
will
   be provided for opening a PR in the PR author's forked repository.
   
   apache/pulsar pull requests should be first tested in your own fork since 
the 
   apache/pulsar CI based on GitHub Actions has constrained resources and quota.
   GitHub Actions provides separate quota for pull requests that are executed 
in 
   a forked repository.
   
   The tests will be run in the forked repository until all PR review comments 
have
   been handled, the tests pass and the PR is approved by a reviewer.
   
   -->
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to