Skip to content

Commit

Permalink
fix: use abs of streamId
Browse files Browse the repository at this point in the history
Signed-off-by: Ning Yu <[email protected]>
  • Loading branch information
Chillax-0v0 committed Nov 25, 2023
1 parent 29f3972 commit 5e3fa45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion s3stream/src/main/java/com/automq/stream/s3/S3Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ private void handleAppendCallback(WalWriteRequest request) {
}

private Lock getStreamCallbackLock(long streamId) {
return streamCallbackLocks[(int) (streamId % NUM_STREAM_CALLBACK_LOCKS)];
return streamCallbackLocks[(int) (Math.abs(streamId) % NUM_STREAM_CALLBACK_LOCKS)];
}

@SuppressWarnings("UnusedReturnValue")
Expand Down

0 comments on commit 5e3fa45

Please sign in to comment.