You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by yu...@apache.org on 2022/07/29 02:48:43 UTC
[rocketmq] branch develop updated (736409bd3 -> 312599966)
This is an automated email from the ASF dual-hosted git repository.
yukon pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
from 736409bd3 [ISSUE #4708] Fix potential NPE in EscapeBridge
new b81e90cbb [ISSUE #4712] add maxConnectionIdle for grpc server
new 312599966 Fix concurrent issues of testScanProducerHeartBeat
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../java/org/apache/rocketmq/proxy/config/ProxyConfig.java | 9 +++++++++
.../org/apache/rocketmq/proxy/grpc/GrpcServerBuilder.java | 12 +++++++-----
.../service/transaction/ClusterTransactionServiceTest.java | 10 +++++-----
3 files changed, 21 insertions(+), 10 deletions(-)
[rocketmq] 01/02: [ISSUE #4712] add maxConnectionIdle for grpc server
Posted by yu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
yukon pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
commit b81e90cbb594f7fc1224477828a575a3ca156c0d
Author: 尘央 <xi...@alibaba-inc.com>
AuthorDate: Wed Jul 27 21:29:50 2022 +0800
[ISSUE #4712] add maxConnectionIdle for grpc server
---
.../java/org/apache/rocketmq/proxy/config/ProxyConfig.java | 9 +++++++++
.../org/apache/rocketmq/proxy/grpc/GrpcServerBuilder.java | 12 +++++++-----
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/proxy/src/main/java/org/apache/rocketmq/proxy/config/ProxyConfig.java b/proxy/src/main/java/org/apache/rocketmq/proxy/config/ProxyConfig.java
index bc7c58b6a..743269aa7 100644
--- a/proxy/src/main/java/org/apache/rocketmq/proxy/config/ProxyConfig.java
+++ b/proxy/src/main/java/org/apache/rocketmq/proxy/config/ProxyConfig.java
@@ -91,6 +91,7 @@ public class ProxyConfig implements ConfigFile {
private int grpcClientProducerBackoffMultiplier = 2;
private long grpcClientConsumerLongPollingTimeoutMillis = Duration.ofSeconds(30).toMillis();
private int grpcClientConsumerLongPollingBatchSize = 32;
+ private long grpcClientIdleTimeMills = Duration.ofSeconds(120).toMillis();
private int channelExpiredInSeconds = 60;
private int contextExpiredInSeconds = 30;
@@ -855,4 +856,12 @@ public class ProxyConfig implements ConfigFile {
public Map<Integer, Long> getDelayLevelTable() {
return delayLevelTable;
}
+
+ public long getGrpcClientIdleTimeMills() {
+ return grpcClientIdleTimeMills;
+ }
+
+ public void setGrpcClientIdleTimeMills(final long grpcClientIdleTimeMills) {
+ this.grpcClientIdleTimeMills = grpcClientIdleTimeMills;
+ }
}
diff --git a/proxy/src/main/java/org/apache/rocketmq/proxy/grpc/GrpcServerBuilder.java b/proxy/src/main/java/org/apache/rocketmq/proxy/grpc/GrpcServerBuilder.java
index 024766bf4..509414b57 100644
--- a/proxy/src/main/java/org/apache/rocketmq/proxy/grpc/GrpcServerBuilder.java
+++ b/proxy/src/main/java/org/apache/rocketmq/proxy/grpc/GrpcServerBuilder.java
@@ -35,6 +35,7 @@ import java.nio.file.Paths;
import java.security.cert.CertificateException;
import java.util.List;
import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
import javax.net.ssl.SSLException;
import org.apache.rocketmq.acl.AccessValidator;
import org.apache.rocketmq.common.constant.LoggerName;
@@ -70,21 +71,23 @@ public class GrpcServerBuilder {
int bossLoopNum = ConfigurationManager.getProxyConfig().getGrpcBossLoopNum();
int workerLoopNum = ConfigurationManager.getProxyConfig().getGrpcWorkerLoopNum();
int maxInboundMessageSize = ConfigurationManager.getProxyConfig().getGrpcMaxInboundMessageSize();
+ long idleTimeMills = ConfigurationManager.getProxyConfig().getGrpcClientIdleTimeMills();
if (ConfigurationManager.getProxyConfig().isEnableGrpcEpoll()) {
- serverBuilder.maxInboundMessageSize(maxInboundMessageSize)
- .bossEventLoopGroup(new EpollEventLoopGroup(bossLoopNum))
+ serverBuilder.bossEventLoopGroup(new EpollEventLoopGroup(bossLoopNum))
.workerEventLoopGroup(new EpollEventLoopGroup(workerLoopNum))
.channelType(EpollServerSocketChannel.class)
.executor(executor);
} else {
- serverBuilder.maxInboundMessageSize(maxInboundMessageSize)
- .bossEventLoopGroup(new NioEventLoopGroup(bossLoopNum))
+ serverBuilder.bossEventLoopGroup(new NioEventLoopGroup(bossLoopNum))
.workerEventLoopGroup(new NioEventLoopGroup(workerLoopNum))
.channelType(NioServerSocketChannel.class)
.executor(executor);
}
+ serverBuilder.maxInboundMessageSize(maxInboundMessageSize)
+ .maxConnectionIdle(idleTimeMills, TimeUnit.MILLISECONDS);
+
log.info(
"grpc server has built. port: {}, tlsKeyPath: {}, tlsCertPath: {}, threadPool: {}, queueCapacity: {}, "
+ "boosLoop: {}, workerLoop: {}, maxInboundMessageSize: {}",
@@ -153,5 +156,4 @@ public class GrpcServerBuilder {
return this;
}
-
}
[rocketmq] 02/02: Fix concurrent issues of testScanProducerHeartBeat
Posted by yu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
yukon pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
commit 312599966447cbebcd80b58eca1410e34b414c0a
Author: 尘央 <xi...@alibaba-inc.com>
AuthorDate: Thu Jul 28 21:34:58 2022 +0800
Fix concurrent issues of testScanProducerHeartBeat
---
.../service/transaction/ClusterTransactionServiceTest.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/proxy/src/test/java/org/apache/rocketmq/proxy/service/transaction/ClusterTransactionServiceTest.java b/proxy/src/test/java/org/apache/rocketmq/proxy/service/transaction/ClusterTransactionServiceTest.java
index 3f84e972a..f18f1eef3 100644
--- a/proxy/src/test/java/org/apache/rocketmq/proxy/service/transaction/ClusterTransactionServiceTest.java
+++ b/proxy/src/test/java/org/apache/rocketmq/proxy/service/transaction/ClusterTransactionServiceTest.java
@@ -176,13 +176,13 @@ public class ClusterTransactionServiceTest extends BaseServiceTest {
assertEquals(Lists.newArrayList(BROKER_ADDR, BROKER_ADDR, BROKER_ADDR2, BROKER_ADDR2),
brokerAddrArgumentCaptor.getAllValues().stream().sorted().collect(Collectors.toList()));
+
List<HeartbeatData> heartbeatDataList = heartbeatDataArgumentCaptor.getAllValues();
- for (ProducerData producerData : heartbeatDataList.get(0).getProducerDataSet()) {
- groupSet.remove(producerData.getGroupName());
- }
- for (ProducerData producerData : heartbeatDataList.get(1).getProducerDataSet()) {
- groupSet.remove(producerData.getGroupName());
+ for (final HeartbeatData heartbeatData : heartbeatDataList) {
+ for (ProducerData producerData : heartbeatData.getProducerDataSet()) {
+ groupSet.remove(producerData.getGroupName());
+ }
}
assertTrue(groupSet.isEmpty());