-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: checker handle source unavailable #1134
base: master
Are you sure you want to change the base?
Conversation
@@ -132,24 +132,17 @@ func (triggerChecker *TriggerChecker) handleFetchError(checkData moira.CheckData | |||
triggerChecker.trigger.ClusterKey(), | |||
) | |||
} | |||
case remote.ErrRemoteTriggerResponse: | |||
timeSinceLastSuccessfulCheck := checkData.Timestamp - checkData.LastSuccessfulCheckTimestamp | |||
if timeSinceLastSuccessfulCheck >= triggerChecker.ttl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Убрал это условие, т.к. оно было очень странным:
- если "повезло" и источник оказался недоступен в момент проверки триггера, то триггер перейдёт в EXCEPTION, если с момента проверки прошло более
ttl
секунд (это которые "Set NODATA if has no value for ttl seconds"). Плюс к этому здесь генерилось 2NotificationEvent
, в случае выполнения условия. - иначе триггер состояние не поменяет + к этому, если источник остаётся не доступным, то триггер вообще не будет проверяться (т.к. если источник недоступен, то триггеры не шедулятся на проверку), т.е. не перейдёт в EXCEPTION
Если я что-то не учёл/не правильно понял, сигнализируйте)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Может это какая-то попытка обработать ситуацию, когда ремоут был недоступен очень давно? Не знаю, тоже нет идей, почему так сделано
PR Summary
In #1085 retries to Graphite remote metrics source were added. So new error
ErrRemoteUnavailable
was added.This PR refactors checker logic to proper handle
ErrRemoteUnavailable
andErrRemoteTriggerResponse
. Also add tests for handling fetch errors