Skip to content

Conversation

@dwnusbaum
Copy link
Member

Trying to fix another observed flake from #9810, see https://github.com/jenkinsci/jenkins/pull/9810/files/9aaa7ba3fe523c07a4ed8d63281dbe86db064465#r1819518792.

Testing done

I ran these tests manually a little bit to check various things, but I do not have easy access to Windows to run the tests in a loop to check flakiness in a robust way. The observed failure is due to log rotation failing to delete a build with this exception:

Also:   java.nio.file.AccessDeniedException: C:\Jenkins\agent\workspace\Core_jenkins_PR-9921\test\target\j h17634935987546233869\jobs\test0\builds\1 -> C:\Jenkins\agent\workspace\Core_jenkins_PR-9921\test\target\j h17634935987546233869\jobs\test0\builds\.1
		at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89)
		at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
		at java.base/sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:317)
		at java.base/sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:293)
		at java.base/java.nio.file.Files.move(Files.java:1432)
		at hudson.model.Run.delete(Run.java:1598)
		at hudson.tasks.LogRotator.perform(LogRotator.java:179)
jenkins.util.io.CompositeIOException: Failed to rotate logs for [test0 #1]
	at hudson.tasks.LogRotator.perform(LogRotator.java:236)
	at hudson.model.Job.logRotate(Job.java:490)
	at jenkins.model.GlobalBuildDiscarderListener.onFinalized(GlobalBuildDiscarderListener.java:51)
	at hudson.model.listeners.RunListener.lambda$fireFinalized$3(RunListener.java:260)
	at jenkins.util.Listeners.lambda$notify$0(Listeners.java:59)
	at jenkins.util.Listeners.notify(Listeners.java:67)
	at hudson.model.listeners.RunListener.fireFinalized(RunListener.java:258)
	at hudson.model.Run.onEndBuilding(Run.java:1985)
	at hudson.model.Run.execute(Run.java:1892)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
	at hudson.model.ResourceController.execute(ResourceController.java:101)
	at hudson.model.Executor.run(Executor.java:446)

My best hypothesis is that the move failed because something else was accessing the directory in question, but given the AccessDeniedException that did not have the typical The process cannot access the file because it is being used by another process message, perhaps the problem was something else entirely.

Proposed changelog entries

N/A

Proposed upgrade guidelines

N/A

### Submitter checklist
- [ ] The Jira issue, if it exists, is well-described.
- [ ] The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see [examples](https://github.com/jenkins-infra/jenkins.io/blob/master/content/_data/changelogs/weekly.yml)). Fill in the **Proposed upgrade guidelines** section only if there are breaking changes or changes that may require extra steps from users during upgrade.
- [x] There is automated testing or an explanation as to why this change has no tests.
- [ ] New public classes, fields, and methods are annotated with `@Restricted` or have `@since TODO` Javadocs, as appropriate.
- [ ] New deprecations are annotated with `@Deprecated(since = "TODO")` or `@Deprecated(forRemoval = true, since = "TODO")`, if applicable.
- [ ] New or substantially changed JavaScript is not defined inline and does not call `eval` to ease future introduction of Content Security Policy (CSP) directives (see [documentation](https://www.jenkins.io/doc/developer/security/csp/)).
- [ ] For dependency updates, there are links to external changelogs and, if possible, full differentials.
- [ ] For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

### Maintainer checklist
- [ ] There are at least two (2) approvals for the pull request and no outstanding requests for change.
- [ ] Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
- [ ] Changelog entries in the pull request title and/or **Proposed changelog entries** are accurate, human-readable, and in the imperative mood.
- [ ] Proper changelog labels are set so that the changelog can be generated automatically.
- [ ] If the change needs additional upgrade steps from users, the `upgrade-guide-needed` label is set and there is a **Proposed upgrade guidelines** section in the pull request title (see [example](https://github.com/jenkinsci/jenkins/pull/4387)).
- [ ] If it would make sense to backport the change to LTS, a Jira issue must exist, be a _Bug_ or _Improvement_, and be labeled as `lts-candidate` to be considered (see [query](https://issues.jenkins.io/issues/?filter=12146)).

Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

FWIW I ran the test (in trunk) 5× on Windows 10 and it passed every time.

Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

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

This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback.

/label ready-for-merge

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Oct 31, 2024
@MarkEWaite MarkEWaite merged commit bec45d7 into jenkinsci:master Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback skip-changelog Should not be shown in the changelog tests This PR adds/removes/updates test cases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants