Jason918 opened a new issue #13560:
URL: https://github.com/apache/pulsar/issues/13560
**Describe the bug**
Producer timeout when sending message with huge properties.
**To Reproduce**
Add the following test case in
`org.apache.pulsar.broker.admin.TopicPoliciesTest`
```
@Test
public void testMaxMessageSizeWithLargeHeader() throws Exception {
this.conf.setMaxMessageSize(100);
@Cleanup
PulsarClient pulsarClient = newPulsarClient(lookupUrl.toString(), 0);
@Cleanup
Producer<byte[]> producer =
pulsarClient.newProducer().topic(persistenceTopic).enableBatching(false).create();
// this will throw PulsarClientException$TimeoutException
producer.newMessage().property("P",
RandomStringUtils.random(9000)).value(new byte[100]).send();
}
```
Got the following exception:
> org.apache.pulsar.client.api.PulsarClientException$TimeoutException: The
producer test-0-2 can not send message to the topic
persistent://my-tenant/my-namespace/test-set-persistence within given timeout :
createdAt 30.001 ns ago, firstSentAt 0.002 ns ago, lastSentAt 0.002 ns ago,
retryCount 275
>
> at
org.apache.pulsar.client.api.PulsarClientException.unwrap(PulsarClientException.java:1008)
> at
org.apache.pulsar.client.impl.TypedMessageBuilderImpl.send(TypedMessageBuilderImpl.java:90)
> at
org.apache.pulsar.broker.admin.TopicPoliciesTest.testMaxMessageSizeWithLargeHeader(TopicPoliciesTest.java:3058)
> at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132)
> at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:599)
> at
org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:174)
> at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
> at
org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:822)
> at
org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:147)
> at
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
> at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
> at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
> at org.testng.TestRunner.privateRun(TestRunner.java:764)
> at org.testng.TestRunner.run(TestRunner.java:585)
> at org.testng.SuiteRunner.runTest(SuiteRunner.java:384)
> at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:378)
> at org.testng.SuiteRunner.privateRun(SuiteRunner.java:337)
> at org.testng.SuiteRunner.run(SuiteRunner.java:286)
> at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
> at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
> at org.testng.TestNG.runSuitesSequentially(TestNG.java:1218)
> at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
> at org.testng.TestNG.runSuites(TestNG.java:1069)
> at org.testng.TestNG.run(TestNG.java:1037)
> at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:66)
> at
com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:109)
**Expected behavior**
Send fail immediately.
**Screenshots**
NA
**Desktop (please complete the following information):**
- OS: macOS
**Additional context**
N/A
--
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]