Skip to content

Commit

Permalink
Merge branch 'master' into rxsocks
Browse files Browse the repository at this point in the history
  • Loading branch information
RockyLOMO committed Dec 7, 2024
2 parents 6fadb80 + 3ac8d64 commit 0937842
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions rxlib/src/main/java/org/rx/io/WALFileStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -346,17 +346,17 @@ public void write(ByteBuf src, int length) {
}

private void ensureWrite(BiAction<IOStream> action) {
long logPosition = meta.logPos;
long logPos = meta.logPos;
lock.writeInvoke(() -> {
if (logPosition != meta.logPos) {
throw new InvalidException("Concurrent error");
// log.warn("Fallback lock");
// lock.writeInvoke(() -> innerWrite(meta.getLogPosition(), action));
// return;
if (logPos != meta.logPos) {
// throw new InvalidException("Concurrent error");
log.warn("Fallback to global lock <- pos:{}", logPos);
lock.writeInvoke(() -> innerWrite(meta.logPos, action));
return;
}

innerWrite(logPosition, action);
}, logPosition);
innerWrite(logPos, action);
}, logPos);
}

void innerWrite(long logPosition, BiAction<IOStream> action) {
Expand Down

0 comments on commit 0937842

Please sign in to comment.