-
Notifications
You must be signed in to change notification settings - Fork 356
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
Conversation
@@ -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()); |
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.
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); |
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.
Remember the last 1000 SCMSources so we can still update the status to Bitbucket.
Not sure understand how a cache solves JENKINS-45643 🤔 |
@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. |
I think the right fix is #147 rather than this :) |
A cache definitely has a side effect 😅 |
@Casz what kind of? |
benjamin, I just tried cloning and testing a build of this branch: 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. |
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. |
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