diff --git a/bench/benchmarker/world/errors.go b/bench/benchmarker/world/errors.go index 86d5dd38..63f1d2d0 100644 --- a/bench/benchmarker/world/errors.go +++ b/bench/benchmarker/world/errors.go @@ -71,6 +71,8 @@ const ( ErrorCodeChairReceivedDataIsWrong // ErrorCodeWrongNearbyChairs 取得した付近の椅子情報に不備があります ErrorCodeWrongNearbyChairs + // ErrorCodeLackOfNearbyChairs 取得した付近の椅子情報が足りません + ErrorCodeLackOfNearbyChairs ) var CriticalErrorCodes = map[ErrorCode]bool{ @@ -110,6 +112,7 @@ var ErrorTexts = map[ErrorCode]string{ ErrorCodeUncontrollableRequestReceived: "アサインされたライドがベンチマーカー外で作られたものであるため処理できません", ErrorCodeChairReceivedDataIsWrong: "椅子が受け取った通知の内容が想定と異なります", ErrorCodeWrongNearbyChairs: "取得した付近の椅子情報に不備があります", + ErrorCodeLackOfNearbyChairs: "付近の椅子情報が想定よりも3つ以上足りていません", } type codeError struct { diff --git a/bench/benchmarker/world/world.go b/bench/benchmarker/world/world.go index 84193778..8cfda354 100644 --- a/bench/benchmarker/world/world.go +++ b/bench/benchmarker/world/world.go @@ -368,6 +368,11 @@ func (w *World) checkNearbyChairsResponse(baseTime time.Time, current Coordinate } checked[chair.ID] = true } + if len(errs) > 0 { + go w.PublishEvent(&EventSoftError{Error: WrapCodeError(ErrorCodeTooOldNearbyChairsResponse, errors.Join(errs...))}) + errs = nil + } + for chair := range w.EmptyChairs.Iter() { if !checked[chair.ServerID] && chair.matchingData == nil && chair.Request == nil && chair.ActivatedAt.Before(baseTime) { ok := false @@ -389,8 +394,9 @@ func (w *World) checkNearbyChairsResponse(baseTime time.Time, current Coordinate } } } - if len(errs) > 0 { - go w.PublishEvent(&EventSoftError{Error: WrapCodeError(ErrorCodeTooOldNearbyChairsResponse, errors.Join(errs...))}) + // 2個までは無くても許容する + if len(errs) >= 3 { + go w.PublishEvent(&EventSoftError{Error: CodeError(ErrorCodeLackOfNearbyChairs)}) } return nil }