@@ -41,6 +41,9 @@ import (
41
41
"github.com/pingcap/tidb/util/memory"
42
42
)
43
43
44
+ // IsChildCloseCalledForTest is used for test
45
+ var IsChildCloseCalledForTest = false
46
+
44
47
var (
45
48
_ Executor = & HashJoinExec {}
46
49
_ Executor = & NestedLoopApplyExec {}
@@ -147,7 +150,11 @@ type hashjoinWorkerResult struct {
147
150
}
148
151
149
152
// Close implements the Executor Close interface.
153
+ << << << < HEAD:executor / join .go
150
154
func (e * HashJoinExec ) Close () error {
155
+ == == == =
156
+ func (e * HashJoinV1Exec ) Close () (err error ) {
157
+ >> >> >> > af367b8a5ae (executor : replace `Call` with `CallWithRecover` in the close of hash join v1 (#61868 )):pkg / executor / join / hash_join_v1.go
151
158
if e .closeCh != nil {
152
159
close (e .closeCh )
153
160
}
@@ -170,9 +177,19 @@ func (e *HashJoinExec) Close() error {
170
177
close (e .probeWorkers [i ].joinChkResourceCh )
171
178
channel .Clear (e .probeWorkers [i ].joinChkResourceCh )
172
179
}
180
+ << << << < HEAD:executor / join .go
173
181
e .probeSideTupleFetcher .probeChkResourceCh = nil
174
182
terror .CallWithRecover (e .rowContainer .Close )
175
183
e .hashJoinCtx .sessCtx .GetSessionVars ().MemTracker .UnbindActionFromHardLimit (e .rowContainer .ActionSpill ())
184
+ == == == =
185
+ e .ProbeSideTupleFetcher .probeChkResourceCh = nil
186
+ util .WithRecovery (func () { err = e .RowContainer .Close () }, func (r any ) {
187
+ if r != nil {
188
+ err = errors .Errorf ("%v" , r )
189
+ }
190
+ })
191
+ e .HashJoinCtxV1 .SessCtx .GetSessionVars ().MemTracker .UnbindActionFromHardLimit (e .RowContainer .ActionSpill ())
192
+ >> >> >> > af367b8a5ae (executor : replace `Call` with `CallWithRecover` in the close of hash join v1 (#61868 )):pkg / executor / join / hash_join_v1 .go
176
193
e .waiterWg .Wait ()
177
194
}
178
195
e .outerMatchedStatus = e .outerMatchedStatus [:0 ]
@@ -192,7 +209,16 @@ func (e *HashJoinExec) Close() error {
192
209
if e .stats != nil {
193
210
defer e .ctx .GetSessionVars ().StmtCtx .RuntimeStatsColl .RegisterStats (e .id , e .stats )
194
211
}
212
+ << << << < HEAD:executor / join .go
195
213
err := e .baseExecutor .Close ()
214
+ == == == =
215
+
216
+ IsChildCloseCalledForTest = true
217
+ childErr := e .BaseExecutor .Close ()
218
+ if childErr != nil {
219
+ return childErr
220
+ }
221
+ >> >> >> > af367b8a5ae (executor : replace `Call` with `CallWithRecover` in the close of hash join v1 (#61868 )):pkg / executor / join / hash_join_v1 .go
196
222
return err
197
223
}
198
224
0 commit comments