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

[JENKINS-60590] Fix AbstractGitSCMSource.retrieve repository leak #798

Merged
merged 1 commit into from
Dec 16, 2019

Conversation

slonopotamus
Copy link
Contributor

@slonopotamus slonopotamus commented Dec 16, 2019

JENKINS-60590 Fix repository leak

This bug is detected by AbstractGitSCMSourceTest.when_commits_added_during_discovery_we_do_not_crash to if run against newer JTH.

Checklist

  • I have read the CONTRIBUTING doc
  • Tests verify my changes
  • Unit tests pass locally with my changes
  • I have added documentation as necessary
  • No Javadoc warnings were introduced with my changes
  • No spotbugs warnings were introduced with my changes
  • Any dependent changes have been merged and published in upstream modules (like git-client-plugin)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

This bug is detected by AbstractGitSCMSourceTest.when_commits_added_during_discovery_we_do_not_crash to if run against newer JTH.
@MarkEWaite MarkEWaite added the bugfix Fixes a bug - used by Release Drafter label Dec 16, 2019
@MarkEWaite MarkEWaite merged commit 7e69985 into jenkinsci:master Dec 16, 2019
@slonopotamus slonopotamus deleted the retrieve-repo-leak branch December 16, 2019 18:24
@oleg-nenashev
Copy link
Member

Thanks, nice fix!

@basil
Copy link
Member

basil commented Dec 19, 2019

Does a similar bug exist further down in the same file, on lines 954–955:

final Repository repository = client.getRepository();
try (RevWalk walk = new RevWalk(repository)) {

@MarkEWaite
Copy link
Contributor

Yes @basil that is the same problem in a different location. Thanks for detecting it!

@MarkEWaite MarkEWaite changed the title Fix repository leak in AbstractGitSCMSource.retrieve [JENKINS-60590] Fix repository leak in AbstractGitSCMSource.retrieve Dec 26, 2019
@MarkEWaite MarkEWaite changed the title [JENKINS-60590] Fix repository leak in AbstractGitSCMSource.retrieve [JENKINS-60590] Fix AbstractGitSCMSource.retrieve repository leak Dec 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixes a bug - used by Release Drafter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants