Skip to content

Commit ffd7a28

Browse files
authored
Merge pull request #324 from scalecube/fix-minor-issue2
Fix minor issues
2 parents ccbc0b2 + c06c87d commit ffd7a28

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cluster/src/main/java/io/scalecube/cluster/membership/MembershipProtocolImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ private enum MembershipUpdateReason {
9898

9999
// Disposables
100100
private final Disposable.Composite actionsDisposables = Disposables.composite();
101+
private final Disposable.Swap disposable = Disposables.swap();
101102

102103
// Scheduled
103104
private final Scheduler scheduler;
@@ -293,6 +294,7 @@ private void start0(MonoSink<Object> sink) {
293294
public void stop() {
294295
// Stop accepting requests, events and sending sync
295296
actionsDisposables.dispose();
297+
disposable.dispose();
296298

297299
// Cancel remove members tasks
298300
for (String memberId : suspicionTimeoutTasks.keySet()) {
@@ -475,7 +477,7 @@ private Optional<Address> selectSyncAddress() {
475477

476478
private void schedulePeriodicSync() {
477479
int syncInterval = membershipConfig.syncInterval();
478-
actionsDisposables.add(
480+
disposable.update(
479481
scheduler.schedulePeriodically(
480482
this::doSync, syncInterval, syncInterval, TimeUnit.MILLISECONDS));
481483
}

transport-parent/transport-api/src/main/java/io/scalecube/cluster/transport/api/Message.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundExcept
222222
for (int i = 0; i < headersSize; i++) {
223223
String name = in.readUTF();
224224
String value = in.readUTF();
225-
headers.put(name, value.equals("null") ? null : value);
225+
headers.put(name, "null".equals(value) ? null : value);
226226
}
227227
this.headers = Collections.unmodifiableMap(headers);
228228
// data

0 commit comments

Comments
 (0)