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

backend: per-arch/per-owner limit fixed #3575

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

praiskup
Copy link
Member

@praiskup praiskup commented Jan 6, 2025

Prior this patch, the per-arch limit was applied to all architectures.

Fixes: #3574

Prior this patch, the per-arch limit was applied to all architectures.

Fixes: fedora-copr#3574
@praiskup
Copy link
Member Author

praiskup commented Jan 6, 2025

Will anyone bless my attempt to hotfix this in prod?

# When _hasher(job) returns None, no limit applies, see
# HashWorkerLimit._groups.add() for more info.
return None
return f"{job.requested_arch}_{job.owner}"
Copy link
Member

Choose a reason for hiding this comment

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

Returning None seems strange. Aren't we supposed to return some string, like this ^^ and something outside this class counts how many same strings are there and compare them to the limit?

Copy link
Member Author

Choose a reason for hiding this comment

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

If we return None for a job, that particular one is not calculated; HashWorkerLimit uses StringCounter.add():

def add(self, string):
""" Add string to counter """
if string is None:
return

Copy link
Member

Choose a reason for hiding this comment

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

I am reading the issue again, and I probably understand now. The None makes sense.

@FrostyX
Copy link
Member

FrostyX commented Jan 7, 2025

Will anyone bless my attempt to hotfix this in prod?

I think we can do that :-)

@praiskup
Copy link
Member Author

praiskup commented Jan 9, 2025

OK to merge?

@FrostyX FrostyX merged commit aa8ef9d into fedora-copr:main Jan 9, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken per-arch backend limit
2 participants