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

(retry-scheduling) Retry logic when scheduling is not accepted #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sbeaulie
Copy link
Contributor

Before this change the call to scheduleBuild would run a jenkins.getQueue().schedule2() and return
the value of .isAccepted() but there was no logic around the case where it is not accepted.
We have seen instances in production where the console logs would print 'Triggering XYZ'
but that build would never make it to the queue, leading the code to then wait forever
for the completion of an inexisting build.
I assume queue contention when isAccepted() is false and that a retry will get around the
problem.

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your master branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

Tests were fixed because with the change they would run 5 times since there was no return value provided for scheduleBuild. I did not add a specific test for the for loop since this is boilerplate and .isAccepted() is Boolean and only really exercised in production.

Before this change the call to scheduleBuild would run a jenkins.getQueue().schedule2() and return
the value of .isAccepted() but there was no logic around the case where it is not accepted.
We have seen instances in production where the console logs would print 'Triggering XYZ'
but that build would never make it to the queue, leading the code to then wait forever
for the completion of an inexisting build.
I assume queue contention when isAccepted() is false and that a retry will get around the
problem.
@sbeaulie
Copy link
Contributor Author

paging someone who knows the jenkins code better, I've seen other plugins get the queue item instead of calling .isAccepted() which one is better?

1 similar comment
@sbeaulie
Copy link
Contributor Author

paging someone who knows the jenkins code better, I've seen other plugins get the queue item instead of calling .isAccepted() which one is better?

@jglick jglick added the bug label Jun 2, 2021
@jglick
Copy link
Member

jglick commented Jun 2, 2021

I assume queue contention when isAccepted() is false and that a retry will get around the problem.

Not necessarily.

This smells like the wrong fix. More likely the caller of scheduleConfigurationBuild is to blame?

BTW I have release permission on this plugin but am not a maintainer really, and recommend switching all uses to Pipeline when possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants