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

Limit the number of binds per consumer that can run concurrently. #1031

Merged
merged 1 commit into from Dec 2, 2015

Conversation

awood
Copy link
Contributor

@awood awood commented Nov 30, 2015

I plan on submitting this as a PR to master as well.

@awood awood force-pushed the awood/consumer-job-throttle branch 2 times, most recently from f9f17bd to 8b17a97 Compare December 1, 2015 17:21
@@ -82,9 +89,33 @@ public static JobDetail bindByPool(String poolId, Consumer consumer, Integer qty
JobDetail detail = newJob(EntitlerJob.class)
.withIdentity("bind_by_pool_" + Util.generateUUID())
.requestRecovery(false) // do not recover the job upon restarts
.storeDurably()
Copy link
Contributor

Choose a reason for hiding this comment

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

Any particular reason why you had to set this? Just curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's required for trigger-less jobs. You get an error if it is not set.

@mstead mstead self-assigned this Dec 1, 2015
@mstead
Copy link
Contributor

mstead commented Dec 2, 2015

retest this please

@mstead
Copy link
Contributor

mstead commented Dec 2, 2015

To make sure that I understand this PR, you are basically checking how many EntitlerJobs are running for an Owner, and if the threshold is reached, queue the job to be executed later?

@mstead
Copy link
Contributor

mstead commented Dec 2, 2015

@awood If my understanding of the PR above is correct, then this looks Ok to me.

Couple of things:

  • please add some detail about the fix in the commit message
  • Spec test failures seem to be due to Jenkins.

Binds can take a long time due to the calculation of compliance rules.
If we don't throttle the number of concurrent bind jobs, it is likely
that some of the jobs will time out waiting to acquire a write-lock in
the database.  This commit changes Pinsetter to only run a configurable
number of bind jobs concurrently.  Any jobs above the threshold are
temporarily paused.
@mstead
Copy link
Contributor

mstead commented Dec 2, 2015

ACK.

@awood awood force-pushed the awood/consumer-job-throttle branch from 8b17a97 to 62a9dd8 Compare December 2, 2015 14:57
mstead added a commit that referenced this pull request Dec 2, 2015
Limit the number of binds per consumer that can run concurrently.
@mstead mstead merged commit 14793be into candlepin-0.9.51-HOTFIX Dec 2, 2015
@awood awood deleted the awood/consumer-job-throttle branch January 25, 2016 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants