Copilot commented on code in PR #7089:
URL: https://github.com/apache/hbase/pull/7089#discussion_r2140530080
##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutatorOverAsyncBufferedMutator.java:
##########
@@ -135,13 +135,15 @@ public void mutate(List<? extends Mutation> mutations)
throws IOException {
long heapSize = mutation.heapSize();
bufferedSize.addAndGet(heapSize);
addListener(fs.get(i), (r, e) -> {
- futures.remove(toComplete);
- bufferedSize.addAndGet(-heapSize);
- if (e != null) {
- errors.add(Pair.newPair(mutation, e));
- toComplete.completeExceptionally(e);
- } else {
- toComplete.complete(r);
+ synchronized (this) {
Review Comment:
Consider using a dedicated lock object instead of synchronizing on 'this' to
isolate the concurrency control for the callback, which may reduce potential
deadlock risks or interference with other synchronized blocks.
```suggestion
synchronized (lock) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]