File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -6991,6 +6991,8 @@ func TestCheckConstraintDropAndColumn(t *testing.T) {
69916991 defer leaktest .AfterTest (t )()
69926992 defer log .Scope (t ).Close (t )
69936993 ctx := context .Background ()
6994+
6995+ // jobControlMu guards changes to the shared delayJobChannels array.
69946996 var jobControlMu syncutil.Mutex
69956997 var delayJobList []string
69966998 var delayJobChannels []chan struct {}
@@ -7002,10 +7004,14 @@ func TestCheckConstraintDropAndColumn(t *testing.T) {
70027004 params .Knobs = base.TestingKnobs {
70037005 SQLSchemaChanger : & sql.SchemaChangerTestingKnobs {
70047006 RunBeforeResume : func (jobID jobspb.JobID ) error {
7007+ // We cannot use defer jobControlMu.Unlock within this routine
7008+ // as we need to unlock the jobControlMu conditionally prior to waiting on
7009+ // `channel` below.
70057010 lockHeld := true
70067011 jobControlMu .Lock ()
70077012 scJob , err := s .JobRegistry ().(* jobs.Registry ).LoadJob (ctx , jobID )
70087013 if err != nil {
7014+ jobControlMu .Unlock ()
70097015 return err
70107016 }
70117017 pl := scJob .Payload ()
You can’t perform that action at this time.
0 commit comments