Skip to content

Commit

Permalink
Merge #75620
Browse files Browse the repository at this point in the history
75620: jobs: make short intervals longer under race r=ajwerner a=ajwerner

We've seen that fast loops on race builds have a hard time keeping up. In the
case of #75616 we see an apparent live-lock situation due to contending low
priority transactions such that the jitter does not help. 10ms under stress
race is actually very short. I know we had problems with the closed timestamp
notifications at that frequency under stress race in the past. Hopefully
this helps deflake #75616.

Release note: None

Co-authored-by: Andrew Werner <[email protected]>
  • Loading branch information
craig[bot] and ajwerner committed Jan 27, 2022
2 parents 715a4db + 6e9e668 commit bb826d2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/jobs/testing_knobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/kv"
"github.com/cockroachdb/cockroach/pkg/scheduledjobs"
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
"github.com/cockroachdb/cockroach/pkg/util"
"github.com/cockroachdb/cockroach/pkg/util/hlc"
)

Expand Down Expand Up @@ -96,7 +97,10 @@ type TestingIntervalOverrides struct {
// NewTestingKnobsWithShortIntervals return a TestingKnobs structure with
// overrides for short adopt and cancel intervals.
func NewTestingKnobsWithShortIntervals() *TestingKnobs {
const defaultShortInterval = 10 * time.Millisecond
defaultShortInterval := 10 * time.Millisecond
if util.RaceEnabled {
defaultShortInterval *= 5
}
return NewTestingKnobsWithIntervals(
defaultShortInterval, defaultShortInterval, defaultShortInterval, defaultShortInterval,
)
Expand Down

0 comments on commit bb826d2

Please sign in to comment.