Skip to content

JENKINS-45643 Fixing bug with inifinite running jobs. #160

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

Closed
wants to merge 1 commit into from

Conversation

benjaminfuchs
Copy link

@benjaminfuchs benjaminfuchs commented Dec 15, 2018

We are using this already in our productive system as a workraround for the issue JENKINS-45643.
Details can be found in the comment:
https://issues.jenkins-ci.org/browse/JENKINS-45643?focusedCommentId=334416&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-334416

@@ -143,11 +155,20 @@ private static void createStatus(@NonNull Run<?, ?> build, @NonNull TaskListener

private static void sendNotifications(Run<?, ?> build, TaskListener listener)
throws IOException, InterruptedException {
final SCMSource s = SCMSource.SourceByItem.findSource(build.getParent());
SCMSource s = SCMSource.SourceByItem.findSource(build.getParent());
Copy link
Author

Choose a reason for hiding this comment

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

This line will fail if the job already got "disabled" (e.g. due to not building feature branches that are also build in a Pull Request).
The job will forever be stuck in Bitbucket as "In Progress" and the user will never be able to merge it.

return;
}
} else {
sourceCache.put(buildName, s);
Copy link
Author

Choose a reason for hiding this comment

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

Remember the last 1000 SCMSources so we can still update the status to Bitbucket.

@jetersen
Copy link
Member

Not sure understand how a cache solves JENKINS-45643 🤔

@benjaminfuchs
Copy link
Author

@Casz The cache helps updating job that already got disabled and "findSource()" will return null. I added it as a workaround since we have been blocked by this ("running" feature branch jobs makes it impossible to merge a PR). I tried to describe it in more detail in the jira ticket.

@jetersen
Copy link
Member

I think the right fix is #147 rather than this :)

@benjaminfuchs
Copy link
Author

@Casz #147 looks similar thanks for the hint.

@benjaminfuchs
Copy link
Author

@Casz seems #147 was reverted since it has some side effects. This PR fixes the issue without side effects.

@jetersen
Copy link
Member

jetersen commented Dec 25, 2018

A cache definitely has a side effect 😅

@benjaminfuchs
Copy link
Author

@Casz what kind of?

@mrkita
Copy link

mrkita commented Jan 3, 2019

benjamin, I just tried cloning and testing a build of this branch:
https://github.com/benjaminfuchs/bitbucket-branch-source-plugin/commits/JENKINS-45643

and it did not work for me. The infinite job wait was still occuring! Is that version different than this pull request, or does something else need to be configured?

If this fix is not desirable to the maintainers (which I can understand), can we please get a proper fix? I see that a fix was reverted due to the job counts reported, but now we are in some broken noman's land.

I tried out 2.2.13 and it works as expected. I will run that for now for our team, but I can't say thats anything but a short term bridge, considering this plugin is a keystone for our operations.

@stale
Copy link

stale bot commented Apr 6, 2019

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 6, 2019
@jetersen jetersen closed this in #172 Apr 7, 2019
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.

3 participants