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
Conversation
f9f17bd
to
8b17a97
Compare
@@ -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() |
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.
Any particular reason why you had to set this? Just curious.
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.
It's required for trigger-less jobs. You get an error if it is not set.
retest this please |
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? |
@awood If my understanding of the PR above is correct, then this looks Ok to me. Couple of things:
|
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.
ACK. |
8b17a97
to
62a9dd8
Compare
Limit the number of binds per consumer that can run concurrently.
I plan on submitting this as a PR to master as well.