* [JENKINS-60351] It should be possible to disable a retry of the
PathRemover
This does not address the issues that the comments and code in
hudons.Util are inconsistent if they are for retries or total number of
attempts (they are currently total number of attempts)
* [JENKINS-60351] Make the code conform to the documentation
maxRetries should control the number of retries not the number of
attempts.
* rename field from DELETION_MAX to DELETION_RETRIES
Atomic moves mean that there is no time point during which the symlink
will not exist.
Otherwise, if there is a user trying to access the symlink and there is
a process trying to update the symlink, there will be a window during
which there is no symlink. When that happens, builds can randomly fail.
Implementation:
Introduce a private createSymlinkAtomic which will atomically create a
symlink in the right place and return true, or return false leaving no
changes to the file system. It does not throw exceptions.
When it fails, the previous code is used instead.
Changes to the existing code are designed to slightly clarify what
objects are and reuse objects instead of creating them multiple times.
This also refactors some test calls to mklink into a package-private Util method due to additional tests needing to create junction points.
Signed-off-by: Matt Sicker <boards@gmail.com>
The simplified form that this replaces has an issue where a file contained somewhere inside a symbolic link is also considered a symbolic link on Windows.
Signed-off-by: Matt Sicker <boards@gmail.com>
This removes duplicated tests from UtilTest that were added in PathRemoverTest. This also ports the sleep/gc strategy for use by default to preserve backward compatibility.
Signed-off-by: Matt Sicker <boards@gmail.com>
* Reduce memory footprint for the plugin info by presizing hashmaps to reduce waste for small maps and interning commonly duplicated plugin strings
* Replace duplicated empty string arrays with the one in MemoryReductionUtil
* Fix interning where strings are null
* Fix to deal with the fact that we directly mutate dependency fields for UpdateSite, sigh
* Reduce starting HashMap size for some hashmaps likely to be empty or tiny
* Cleanup per review comments
* Trim some extra waste out of the UpdateSite warnings
* Fix count of optional dependencies
* Move predicates for dependency matching to top-level static final field so they are not duplicated