charlesconnell commented on code in PR #7131: URL: https://github.com/apache/hbase/pull/7131#discussion_r2175794027
########## hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncTableImpl.java: ########## @@ -796,75 +800,130 @@ private boolean locateFinished(RegionInfo region, byte[] endKey, boolean endKeyI private <S, R> void coprocessorServiceUntilComplete(Function<RpcChannel, S> stubMaker, ServiceCaller<S, R> callable, PartialResultCoprocessorCallback<S, R> callback, - AtomicBoolean locateFinished, AtomicInteger unfinishedRequest, RegionInfo region, Span span) { + MultiRegionCoprocessorServiceProgress<R> progress, RegionInfo region, Span span) { addListener(coprocessorService(stubMaker, callable, region, region.getStartKey()), (r, e) -> { try (Scope ignored = span.makeCurrent()) { - if (e != null) { - callback.onRegionError(region, e); - } else { - callback.onRegionComplete(region, r); - } + if (e instanceof RegionNoLongerExistsException) { + RegionInfo newRegion = ((RegionNoLongerExistsException) e).getNewRegionInfo(); + if (progress.markNewRegionAndCheckNeedsToBeHandled(newRegion)) { + if (progress.hasResponseStarted(region)) { Review Comment: I imagine that this check in one thread will be racing against responses coming in on other threads. Is this logic safe without synchronization? -- 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: issues-unsubscr...@hbase.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org