* 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
* [JENKINS-52729] Demonstrating issue with Launcher.ProcStarter.stdout(TaskListener).
* [JENKINS-52729] Properly remote the TaskListener.
* Defend test against a possible problem on Windows.
* FindBugs
* Fix a Windows test failure. There is no C:\Windows\System32\echo.exe; it is a cmd.exe built-in.
* Clarify in Javadoc that TaskListener is remotable.
* A call to stdout(TaskListener) should be countermanded by a call to stdout(OutputStream), which was true for local but not remote launchers.
Pulls in fixes for: JENKINS-48133, JENKINS-48055, JENKINS-37566, JENKINS-48309, JENKINS-47965, JENKINS-48130, JENKINS-37670, JENKINS-37566, JENKINS-46724
This change also adds some missing null/closing channel checks in the core.
In some cases the change prevents spawning threads if the channel is in the invalid state.
* Annotate and document methods of hudson.Launcher
* Fix newly introduced FindBugs issues in hudson.Launcher
* Remove brackets from FilePath#createLauncher() to avoid the merge conflict
* [JENKINS-23271] - Process statuses of Remote process join() operations directly inside methods
* [JENKINS-23271] - Also prevent the issue when the kill() command is the last call in the usage sequence
* [JENKINS-23271] - Prevent the prelimimary deallocation of the Proc instance by GC
It is a hackish way, which likely prevents a preliminary deallocation of the spawned RemoteProc instance, which we see in JENKINS-23271. Proc instance was not actually required in the original code since we were creating and using RemoteInvocationHandler wrapper only, and the theory discussed with @stephenc was that object gets removed by Java8 garbage collector before we get into join().
This fix enforces the persistency of ProcStarter#start() result by adding logging and the enforced volatile field (maybe the last one is not really required, but JIT compiler in Java implementations may be smart enough to skip unused loggers)
This is a pretty old fix from August, which has been soak tested on my instance for several weeks (mid-August => Jenkins World). On the reference instance (just a small Jenkins instance with 4 agents and very frequent builds with CommandInterpreter steps) I saw 2 failures over the period. On the fixed instance - 0. It does not proof anything, but at least the fix was soak tested a bit
* [JENKINS-23271] - Get rid of the procHolderForJoin field
* [JENKINS-23271] - Also put the check into the finally statement as @stephenc proposed
* Remove assert
In addition to cluttering the namespace, unused imports generate
compiler warnings, introducing noise and obscuring more important
compiler warnings. This change removes them.
This launcher Allows subclasses to only implement methods they want to override.
Originally, this launcher has been implemented in Custom Tools Plugin, but there are many duplicates in other plugins => it would be useful to have it in Jenkins core.
Resolves https://issues.jenkins-ci.org/browse/JENKINS-19454
Signed-off-by: Oleg Nenashev <nenashev@synopsys.com>
(Should this field be made a [LinkedHash]Map<String,String> or even EnvVars?
It is protected in a final class, so effectively package-private, thus not a b/w compat issue.)
This allows us to pass in a proper Launcher that handles all the environment variables without asking individual user to fill in a proper environment variables
I added a mode where one can launch a child process without the built-in pumping support, making it trivial to read until EOF in the distributed environments.
This concludes the fix.