Skip to content

Commit 8fe21b1

Browse files
committed
Update lock in PushManager and SSEClient. Update rc version
1 parent 5fc3a31 commit 8fe21b1

File tree

7 files changed

+15
-17
lines changed

7 files changed

+15
-17
lines changed

client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>io.split.client</groupId>
77
<artifactId>java-client-parent</artifactId>
8-
<version>4.12.0</version>
8+
<version>4.12.1-rc</version>
99
</parent>
1010
<artifactId>java-client</artifactId>
1111
<packaging>jar</packaging>

client/src/main/java/io/split/engine/common/PushManagerImp.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ public class PushManagerImp implements PushManager {
4444
private final FeatureFlagsWorker _featureFlagsWorker;
4545
private final Worker<SegmentQueueDto> _segmentWorker;
4646
private final PushStatusTracker _pushStatusTracker;
47-
private static final Lock startLock = new ReentrantLock();
48-
private static final Lock stopLock = new ReentrantLock();
47+
private static final Lock lock = new ReentrantLock();
4948

5049
private Future<?> _nextTokenRefreshTask;
5150
private final ScheduledExecutorService _scheduledExecutorService;
@@ -98,7 +97,7 @@ public static PushManagerImp build(Synchronizer synchronizer,
9897
@Override
9998
public void start() {
10099
try {
101-
startLock.lock();
100+
lock.lock();
102101
AuthenticationResponse response = _authApiClient.Authenticate();
103102
_log.debug(String.format("Auth service response pushEnabled: %s", response.isPushEnabled()));
104103
if (response.isPushEnabled() && startSse(response.getToken(), response.getChannels())) {
@@ -115,18 +114,18 @@ public void start() {
115114
_pushStatusTracker.forcePushDisable();
116115
}
117116
} finally {
118-
startLock.unlock();
117+
lock.unlock();
119118
}
120119
}
121120

122121
@Override
123122
public void stop() {
124123
try {
125-
stopLock.lock();
124+
lock.lock();
126125
_log.debug("Stopping PushManagerImp");
127126
cleanUpResources();
128127
} finally {
129-
stopLock.unlock();
128+
lock.unlock();
130129
}
131130
}
132131

client/src/main/java/io/split/engine/sse/client/SSEClient.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ private enum ConnectionState {
5050
private final static String SOCKET_CLOSED_MESSAGE = "Socket closed";
5151
private final static String KEEP_ALIVE_PAYLOAD = ":keepalive\n";
5252
private final static long CONNECT_TIMEOUT = 30000;
53-
private static final Lock openLock = new ReentrantLock();
54-
private static final Lock closeLock = new ReentrantLock();
53+
private static final Lock lock = new ReentrantLock();
5554
private static final Logger _log = LoggerFactory.getLogger(SSEClient.class);
5655
private final ExecutorService _connectionExecutor;
5756
private final CloseableHttpClient _client;
@@ -81,7 +80,7 @@ public SSEClient(Function<RawEvent, Void> eventCallback,
8180

8281
public boolean open(URI uri) {
8382
try {
84-
openLock.lock();
83+
lock.lock();
8584
if (isOpen()) {
8685
_log.info("SSEClient already open.");
8786
return false;
@@ -106,7 +105,7 @@ public boolean open(URI uri) {
106105
}
107106
return isOpen();
108107
} finally {
109-
openLock.unlock();
108+
lock.unlock();
110109
}
111110
}
112111

@@ -116,7 +115,7 @@ public boolean isOpen() {
116115

117116
public void close() {
118117
try {
119-
closeLock.lock();
118+
lock.lock();
120119
_forcedStop.set(true);
121120
if (_state.compareAndSet(ConnectionState.OPEN, ConnectionState.CLOSED)) {
122121
if (_ongoingResponse.get() != null) {
@@ -129,7 +128,7 @@ public void close() {
129128
}
130129
}
131130
} finally {
132-
closeLock.unlock();
131+
lock.unlock();
133132
}
134133
}
135134

pluggable-storage/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>java-client-parent</artifactId>
88
<groupId>io.split.client</groupId>
9-
<version>4.12.0</version>
9+
<version>4.12.1-rc</version>
1010
</parent>
1111

1212
<version>2.1.0</version>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>io.split.client</groupId>
66
<artifactId>java-client-parent</artifactId>
7-
<version>4.12.0</version>
7+
<version>4.12.1-rc</version>
88
<dependencyManagement>
99
<dependencies>
1010
<dependency>

redis-wrapper/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>java-client-parent</artifactId>
88
<groupId>io.split.client</groupId>
9-
<version>4.12.0</version>
9+
<version>4.12.1-rc</version>
1010
</parent>
1111
<artifactId>redis-wrapper</artifactId>
1212
<version>3.1.0</version>

testing/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>io.split.client</groupId>
77
<artifactId>java-client-parent</artifactId>
8-
<version>4.12.0</version>
8+
<version>4.12.1-rc</version>
99
</parent>
1010
<artifactId>java-client-testing</artifactId>
1111
<packaging>jar</packaging>

0 commit comments

Comments
 (0)