Skip to content
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

feat: #tno-2264 - updated ingestmanager to allow restart after pre-set delay #1468

Merged
merged 2 commits into from
Jan 29, 2024

Conversation

kylgarmor
Copy link
Contributor

@kylgarmor kylgarmor commented Jan 29, 2024

  • added new configuration value ResetRetryAfterDelayMs
  • when RunAsAsync is called we check to see if the ingest has reach max failures
  • if maxFailures hit, check if ResetRetryAfterDelayMs is set
  • compare LastRunAt PLUS ResetRetryAfterDelayMs to UTC.Now
  • if we are past the delay, reset the failure count and allow the service to move forward

image

  • have set 1hr as the default reset interval to all existing ingests

…t delay

- added new configuration value ResetRetryAfterDelayMs
- when RunAsAsync is called we check to see if the ingest has reach max failures
- if maxFailures hit, check if ResetRetryAfterDelayMs is set
- compare LastRunAt PLUS ResetRetryAfterDelayMs to UTC.Now
- if we are past the delay, reset the failure count and allow the service to move forward
@kylgarmor kylgarmor requested a review from Fosol January 29, 2024 20:44
@kylgarmor kylgarmor self-assigned this Jan 29, 2024
@kylgarmor kylgarmor added enhancement New feature or request DB Migration A DB Migration may require refreshing or simply updating your database. tno-core update Indicates that there have been changes to our tno-core package, which can pose concurrency issues. editor labels Jan 29, 2024
@@ -133,8 +133,15 @@ public override async Task RunAsync()
{
if (ingest.FailedAttempts >= ingest.RetryLimit)
{
this.Logger.LogWarning("Ingest '{name}' has reached maximum failure limit", ingest.Name);
continue;
if (ingest.LastRanOn.HasValue && ingest.ResetRetryAfterDelayMs > 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this then keep retrying after X ms until it is successful?

Copy link
Contributor Author

@kylgarmor kylgarmor Jan 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. If want to, we could introduce another couple of values which track consecutive "resets" and "maxResetsAllowed".
Current implementation would hit maxFailures, then wait untl delay has passed and then reset failureCount and retry again.

…t delay

- added script to set default reset interval to 1hr
@kylgarmor kylgarmor merged commit 27cae8c into bcgov:dev Jan 29, 2024
3 checks passed
@kylgarmor kylgarmor deleted the tno-2264 branch January 29, 2024 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DB Migration A DB Migration may require refreshing or simply updating your database. editor enhancement New feature or request tno-core update Indicates that there have been changes to our tno-core package, which can pose concurrency issues.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants