Skip to content

Commit

Permalink
Address the comment
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <ghzpotato@gmail.com>
  • Loading branch information
JmPotato committed Aug 12, 2024
1 parent ce823b1 commit e57597a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion pkg/domain/resourcegroup/runaway.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,16 @@ func (r *RunawayChecker) BeforeExecutor() error {
// Take action if needed.
switch action {
case rmpb.RunawayAction_Kill:
// Return an error to interrupt the query.
return exeerrors.ErrResourceGroupQueryRunawayQuarantine
case rmpb.RunawayAction_CoolDown:
// This action should be done in BeforeCopRequest.
// This action will be handled in `BeforeCopRequest`.
return nil
case rmpb.RunawayAction_DryRun:
// Noop.
return nil
default:
// Continue to examine other convicts.
}
}
return nil
Expand Down
4 changes: 2 additions & 2 deletions pkg/executor/infoschema_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -3640,10 +3640,10 @@ func (e *memtableRetriever) setDataFromRunawayWatches(sctx sessionctx.Context) e
watch.ResourceGroupName,
watch.StartTime.UTC().Format(time.DateTime),
watch.EndTime.UTC().Format(time.DateTime),
rmpb.RunawayWatchType_name[int32(watch.Watch)],
watch.Watch.String(),
watch.WatchText,
watch.Source,
rmpb.RunawayAction_name[int32(action)],
action.String(),
)
if watch.EndTime.Equal(resourcegroup.NullTime) {
row[3].SetString("UNLIMITED", mysql.DefaultCollationName)
Expand Down

0 comments on commit e57597a

Please sign in to comment.