Technoboy- commented on code in PR #15321:
URL: https://github.com/apache/pulsar/pull/15321#discussion_r858646839
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TypedMessageBuilderImpl.java:
##########
@@ -84,7 +84,7 @@ public MessageId send() throws PulsarClientException {
producer.triggerFlush();
}
- return sendFuture.get();
+ return sendFuture.get(Integer.MAX_VALUE, TimeUnit.MILLISECONDS);
Review Comment:
> > Please use `sendTimeoutMs`
>
> Do you mean to modify producter sendTimeoutMs configuration? This PR is to
avoid `CompletableFuture#get()` performance issues in some scenarios. In 8u,
`CompletableFuture#get()` calls `Runtime.availableProcessors` during spin in
waitingGet. `Runtime.availableProcessors` performance is not good ,
[link](https://bugs.openjdk.java.net/browse/JDK-8227006). So use
`CompletableFuture#get(long, TimeUnit)` instead.
How about add a short comment with link above this line ?
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TypedMessageBuilderImpl.java:
##########
@@ -84,7 +84,7 @@ public MessageId send() throws PulsarClientException {
producer.triggerFlush();
}
- return sendFuture.get();
+ return sendFuture.get(Integer.MAX_VALUE, TimeUnit.MILLISECONDS);
Review Comment:
> > Please use `sendTimeoutMs`
>
> Do you mean to modify producter sendTimeoutMs configuration? This PR is to
avoid `CompletableFuture#get()` performance issues in some scenarios. In 8u,
`CompletableFuture#get()` calls `Runtime.availableProcessors` during spin in
waitingGet. `Runtime.availableProcessors` performance is not good ,
[link](https://bugs.openjdk.java.net/browse/JDK-8227006). So use
`CompletableFuture#get(long, TimeUnit)` instead.
How about adding a short comment with link above this line ?
--
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]