Skip to content

Commit

Permalink
Merge branch 'bugfix/remove_connect_retry'
Browse files Browse the repository at this point in the history
  • Loading branch information
mike.wq committed May 14, 2024
2 parents 50d582f + 4e78c77 commit 9ef32c1
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 20 deletions.
2 changes: 1 addition & 1 deletion app-stream-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>open-app-stream-client</artifactId>
<groupId>com.dingtalk.open</groupId>
<version>1.3.2</version>
<version>1.3.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
4 changes: 2 additions & 2 deletions app-stream-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<parent>
<groupId>com.dingtalk.open</groupId>
<artifactId>open-app-stream-client</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>app-stream-client</artifactId>
<packaging>jar</packaging>
<version>1.3.2</version>
<version>1.3.3</version>
<name>app-stream-client</name>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions app-stream-network/app-stream-network-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<parent>
<groupId>com.dingtalk.open</groupId>
<artifactId>app-stream-network</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>app-stream-network-api</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>
<packaging>jar</packaging>

<name>app-stream-network-api</name>
Expand Down
2 changes: 1 addition & 1 deletion app-stream-network/app-stream-network-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.dingtalk.open</groupId>
<artifactId>app-stream-network</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ public void run() {
closeSession(previous.getId());
}
}
Session session = new RetryRunner<Session>(MAX_RETRY_COUNT, new ExponentialBackoffPolicy())
.run(() -> Connector.connect(connection, new TransportConnectionListener(), connectionTimeout, connectionTTL, keepAliveIdle));
Session session = Connector.connect(connection, new TransportConnectionListener(), connectionTimeout, connectionTTL, keepAliveIdle);
if (session == null) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion app-stream-network/app-stream-network-rsocket/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.dingtalk.open</groupId>
<artifactId>app-stream-network</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion app-stream-network/app-stream-network-ws/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.dingtalk.open</groupId>
<artifactId>app-stream-network</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@
public class KeepAliveHandler extends SimpleChannelInboundHandler<PongWebSocketFrame> {
private static final InternalLogger LOGGER = InternalLoggerFactory.getLogger(KeepAliveHandler.class);
private final Duration timeout;
private final HashedWheelTimer timer;
private final static HashedWheelTimer TIMER = new HashedWheelTimer();
private Channel channel;
private final Map<String, Timeout> timeouts;
private final AtomicBoolean active;

public KeepAliveHandler(Duration timeout) {
this.timeout = timeout;
this.timer = new HashedWheelTimer();
this.active = new AtomicBoolean(false);
this.timeouts = new ConcurrentHashMap<>();
}
Expand Down Expand Up @@ -82,7 +81,6 @@ private void shutdown() {
entry.getValue().cancel();
it.remove();
}
this.timer.stop();
}

private class PingTask implements Runnable {
Expand All @@ -96,7 +94,7 @@ public void run() {
PingWebSocketFrame frame = new PingWebSocketFrame(byteBuf);
channel.writeAndFlush(frame).addListener(future -> {
if (future.isSuccess()) {
Timeout pingTimeout = timer.newTimeout(timeout -> {
Timeout pingTimeout = TIMER.newTimeout(timeout -> {
LOGGER.warn("[DingTalk] connection ping timeout, channel is closing");
timeouts.remove(seq);
channel.close();
Expand Down
2 changes: 1 addition & 1 deletion app-stream-network/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>open-app-stream-client</artifactId>
<groupId>com.dingtalk.open</groupId>
<version>1.3.2</version>
<version>1.3.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion app-stream-protocol/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.dingtalk.open</groupId>
<artifactId>open-app-stream-client</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>
</parent>

<artifactId>app-stream-protocol</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions dingtalk-stream/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<parent>
<groupId>com.dingtalk.open</groupId>
<artifactId>open-app-stream-client</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>dingtalk-stream</artifactId>
<packaging>jar</packaging>
<version>1.3.2</version>
<version>1.3.3</version>
<name>app-stream-client</name>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>com.dingtalk.open</groupId>
<artifactId>open-app-stream-client</artifactId>
<packaging>pom</packaging>
<version>1.3.2</version>
<version>1.3.3</version>
<modules>
<module>app-stream-client</module>
<module>app-stream-api</module>
Expand Down
2 changes: 1 addition & 1 deletion version.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

mvn versions:set -DnewVersion=1.3.2
mvn versions:set -DnewVersion=1.3.3

0 comments on commit 9ef32c1

Please sign in to comment.