Skip to content

Commit

Permalink
reachedConCount thread safe actiontech#1139
Browse files Browse the repository at this point in the history
  • Loading branch information
yanhuqing666 authored and Lordess committed May 27, 2020
1 parent 17b0580 commit ca67bc2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/
public class MultiNodeEasyMergeHandler extends MultiNodeMergeHandler {
private static final Logger LOGGER = LoggerFactory.getLogger(MultiNodeEasyMergeHandler.class);
private int rowEndConCount = 0;

public MultiNodeEasyMergeHandler(long id, RouteResultsetNode[] route, boolean autocommit, NonBlockingSession session) {
super(id, route, autocommit, session);
Expand Down Expand Up @@ -88,7 +89,7 @@ public void rowEofResponse(byte[] data, boolean isLeft, BackendConnection conn)
return;
lock.lock();
try {
if (reachedConCount == route.length) {
if (++rowEndConCount == route.length) {
session.setHandlerEnd(this);
nextHandler.rowEofResponse(null, this.isLeft, conn);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public abstract class MultiNodeMergeHandler extends OwnThreadDMLHandler {
protected final ReentrantLock lock;
final List<BaseSelectHandler> exeHandlers;
protected RouteResultsetNode[] route;
int reachedConCount;
int reachedConCount = 0;

public MultiNodeMergeHandler(long id, RouteResultsetNode[] route, boolean autocommit, NonBlockingSession session) {
super(id, session);
Expand Down

0 comments on commit ca67bc2

Please sign in to comment.