Commit 9225550 1 parent 0cbb4ff commit 9225550 Copy full SHA for 9225550
File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -460,6 +460,13 @@ func (s *SubscriptionClient) onTableDrained(rt *subscribedSpan) {
460
460
461
461
// Note: don't block the caller, otherwise there may be deadlock
462
462
func (s * SubscriptionClient ) onRegionFail (errInfo regionErrorInfo ) {
463
+ // unlock the range early to prevent blocking the range.
464
+ if errInfo .subscribedSpan .rangeLock .UnlockRange (
465
+ errInfo .span .StartKey , errInfo .span .EndKey ,
466
+ errInfo .verID .GetID (), errInfo .verID .GetVer (), errInfo .resolvedTs ()) {
467
+ s .onTableDrained (errInfo .subscribedSpan )
468
+ return
469
+ }
463
470
s .errCache .add (errInfo )
464
471
}
465
472
@@ -706,13 +713,6 @@ func (s *SubscriptionClient) handleErrors(ctx context.Context) error {
706
713
}
707
714
708
715
func (s * SubscriptionClient ) doHandleError (ctx context.Context , errInfo regionErrorInfo ) error {
709
- if errInfo .subscribedSpan .rangeLock .UnlockRange (
710
- errInfo .span .StartKey , errInfo .span .EndKey ,
711
- errInfo .verID .GetID (), errInfo .verID .GetVer (), errInfo .resolvedTs ()) {
712
- s .onTableDrained (errInfo .subscribedSpan )
713
- return nil
714
- }
715
-
716
716
err := errors .Cause (errInfo .err )
717
717
switch eerr := err .(type ) {
718
718
case * eventError :
You can’t perform that action at this time.
0 commit comments