Skip to content

Conversation

@zzzeid
Copy link
Contributor

@zzzeid zzzeid commented Mar 6, 2024

  • add warning log for large queue size (bug 1879896)
  • add warning log for too many attempts (bug 1880310)

- add warning log for large queue size (bug 1879896)
- add warning log for too many attempts (bug 1880310)
@zzzeid zzzeid requested a review from cgsheeh March 7, 2024 18:50
for r in self.applicable_repos
if treestatus_subsystem.client.is_open(repo_clone_subsystem.repos[r].tree)
]
logger.info(f"{len(self.enabled_repos)} enabled repos: {self.enabled_repos}")
Copy link
Member

Choose a reason for hiding this comment

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

Was removing this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I am not sure if it is a useful thing to have in the logs constantly, since this is basically the repos in the environment variable, minus any trees that are closed. Perhaps it makes more sense to add it as a warning instead, if the two don't match?

f"{len(self.applicable_repos)} applicable repos: {self.applicable_repos}"
def check_landing_worker_warnings(self):
"""Log messages that show various important statistics about the landing worker."""
TOO_MANY_ATTEMPTS_THRESHOLD = 10
Copy link
Member

Choose a reason for hiding this comment

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

Move this to the class-level, or perhaps add it as a kwarg so we can override it.

"""Log messages that show various important statistics about the landing worker."""
TOO_MANY_ATTEMPTS_THRESHOLD = 10
# TODO: should this threshold be different for try landing worker?
QUEUE_SIZE_THRESHOLD = 20
Copy link
Member

Choose a reason for hiding this comment

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

Same with this threshold variable.

LandingJob.status.in_(ACTIVE_STATUSES)
).count()
if queue_size >= QUEUE_SIZE_THRESHOLD:
logger.warning(f"The landing queue size of {queue_size} exceeds threshold")
Copy link
Member

Choose a reason for hiding this comment

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

Add the threshold size here like f"... exceeds threshold {QUEUE_SIZE_THRESHOLD}."

Comment on lines 94 to 98
ACTIVE_STATUSES = (
LandingJobStatus.SUBMITTED,
LandingJobStatus.DEFERRED,
LandingJobStatus.IN_PROGRESS,
)
Copy link
Member

Choose a reason for hiding this comment

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

This tuple is a copy of the applicable_statuses variable in job_queue_query. Let's move them to a variable where they can be shared (maybe a class-level LandingJobStatus.active_statuses or something along those lines).

Comment on lines +111 to +115
if runaway_jobs.count() > 0:
job = runaway_jobs.all()[0]
logger.warning(
f"Active landing job ({job}) has too many attempts ({job.attempts})"
)
Copy link
Member

Choose a reason for hiding this comment

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

Should we cancel the job in that case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would be a good idea, but I think it would be outside the scope of this PR since it would require us to also send a notification email. Maybe it can be done as a follow up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants