Commit Graph
110 Commits
Author SHA1 Message Date
James Nord 1f946961b9 s/javax.annotation.CheckForNull/edu.umd.cs.findbugs.annotations.CheckForNull/g 2020-03-26 16:12:35 +00:00
James Nord 819f80b12f s/javax.annotation.Nonnull/edu.umd.cs.findbugs.annotations.NonNull/g 2020-03-26 11:14:41 +00:00
Stefan Spieker 838f4ab504 removed obsolete SpotBugs suppresses 2019-12-23 16:04:30 +01:00
Basil Crow 861855953b Replace <code>…</code> with {@code …} 2019-10-19 14:02:59 -07:00
StefanSpiekerandEvaristo Gutiérrez 89ee2e822a [JENKINS-36720] - Fix SpotBugs warnings for "Non-null field is not initialized" values (#4249)
* add one Spotbugs exclude and replaced Nonnull with CheckForNull because assigned variables have CheckForNull annotations

* Update core/src/main/java/jenkins/security/NonSerializableSecurityContext.java

Co-Authored-By: Evaristo Gutiérrez <egutierrez@cloudbees.com>
2019-10-18 00:30:31 +02:00
Raihaan Shouhell 617bbb531e Update the minimum required Remoting version to 3.14 (#4208)
* Let remoting handle missing channels

* Bump minimum remoting version to 3.14
2019-09-27 22:59:03 +02:00
Gustavo de Souza Bezerra 0e62b68012 [JENKINS-57678] - Change getInstance() (deprecated) to get() (#4042)
* Change getInstance() (deprecated) to get()

* Reverting modifications according review

* Changing for use the variable
2019-06-27 17:24:45 +02:00
Baptiste Mathus 850168fdb2 Merge pull request #3961 from jglick/TaskListener-flush
Adjusted TaskListener flushing in remote code
2019-04-11 15:17:30 +02:00
Jesse Glick 86348bbb70 ArgumentListBuilder2Test.slaveMask failure.
(cherry picked from commit 83361ae832)
2019-04-02 10:54:16 -04:00
Jesse Glick 27e3d51465 RemoteLauncher.toString override for easier debugging. 2019-04-01 15:30:25 -04:00
Josh Soref 0fac99838c OpenJDK6: Collection.toArray() is apparently smart in modern java 2019-02-20 22:11:26 -05:00
Josh Soref 264980c707 Java 7: omit explit type in favor of <> 2019-02-20 21:51:03 -05:00
Sam Van Oort e0ed9a86e0 Micro-optimizations to Plugin data to reduce minimum memory for Jenkins (#3654)
* 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
2018-10-06 12:49:07 +02:00
Oleg Nenashev ba08ebc97a Refactoring: Cleanup <tt> tags from the Jenkins core Javadoc 2018-09-21 17:47:11 -07:00
Jesse Glick ebd71116c1 [JENKINS-52729] Launcher.ProcStarter.stdout(TaskListener) discards remotability (#3563)
* [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.
2018-08-02 19:52:12 +02:00
Oleg Nenashev 01b8ed8c71 [JENKINS-48761] - Address review comments from @jglick 2018-01-03 20:59:11 +01:00
Oleg Nenashev 4eb314b327 [JENKINS-48761] - Restore binary compatibility with agents running old Remoting versions 2018-01-02 22:10:37 +01:00
Oleg Nenashev cb3990a4d6 Update to Remoting 3.15 and Cleanup issues in Channel#current() usages (#3145)
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.
2017-12-22 18:02:44 +01:00
Nicolas De Loof 6c5856ed21 prefer ‘agent.jar’ over ‘slave.jar’ 2017-09-07 09:46:10 +02:00
Oleg Nenashev 095310afdd Annotate and document methods of hudson.Launcher (#2920)
* 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
2017-06-24 19:17:11 +02:00
Oleg Nenashev 467cf9adcd Annotate Launcher and LauncherDecorator methods 2017-05-27 11:35:37 +02:00
Daniel Beck 2a03dda885 Reference redirectors and jenkins.io as much as possible (#2756)
* Reference redirectors and jenkins.io as much as possible

* Something went wrong, so this is a troubleshooting URL

* More specific redirect URLs
2017-02-25 19:56:01 +01:00
Josh Soref 496703d0fe Spelling fixes in changelogs, Javadoc, logs and UI (#2718)
* spelling: abstract

* spelling: about

* spelling: absolute

* spelling: across

* spelling: activity

* spelling: actually

* spelling: addition

* spelling: allocating

* spelling: ambiguous

* spelling: analyzes

* spelling: analysis

* spelling: another

* spelling: appear

* spelling: arbitrary

* spelling: artifact

* spelling: assignment

* spelling: associated

* spelling: augment

* spelling: authentication

* spelling: automatically

* spelling: available

* spelling: availability

* spelling: because

* spelling: background

* spelling: beginning

* spelling: boolean

* spelling: browsers

* spelling: building

* spelling: calculation

* spelling: channel

* spelling: column

* spelling: concatenation

* spelling: connect

* spelling: contribute

* spelling: convert

* spelling: copied

* spelling: couldn't

* spelling: scrambled

* spelling: creates-a

* spelling: curr-entry

* spelling: customize

* spelling: diagnostic

* spelling: contain

* spelling: default

* spelling: delimiter

* spelling: descriptor

* spelling: disambiguates

* spelling: different

* spelling: diligently

* spelling: disabled

* spelling: discovered

* spelling: display

* spelling: doesn't

* spelling: dollar

* spelling: downstream

* spelling: dynamically

* spelling: preemptively

* spelling: encrypt

* spelling: erroneous

* spelling: examine

* spelling: existence

* spelling: value

* spelling: february

* spelling: handling

* spelling: hostname

* spelling: convenient

* spelling: identify

* spelling: implementation

* spelling: incorrect

* spelling: individual

* spelling: initialization

* spelling: initialized

* spelling: inputstream

* spelling: instantiated

* spelling: instantiation

* spelling: intended

* spelling: interpreted

* spelling: interrupted

* spelling: invocations

* spelling: kern

* spelling: localization

* spelling: logger

* spelling: malfunctioning

* spelling: methods

* spelling: monitor

* spelling: mutator

* spelling: multiple

* spelling: object

* spelling: configured

* spelling: optionally

* spelling: option

* spelling: overridden

* spelling: parameterized

* spelling: parent

* spelling: permissions

* spelling: plugin

* spelling: potentially

* spelling: preferable

* spelling: problems like

* spelling: programmatically

* spelling: property

* spelling: reallocate

* spelling: recommended

* spelling: redirected

* spelling: registered

* spelling: reliable

* spelling: remember

* spelling: recurrence

* spelling: repeatable

* spelling: repeated

* spelling: resource

* spelling: retrieve

* spelling: returned

* spelling: revision

* spelling: sandwich

* spelling: separator

* spelling: serialization

* spelling: settings

* spelling: shadow

* spelling: should

* spelling: someone

* spelling: source

* spelling: specified

* spelling: style

* spelling: subversion

* spelling: sufficient

* spelling: supplementary

* spelling: suppressing

* spelling: synchronization

* spelling: synchronized

* spelling: this

* spelling: transitioning

* spelling: termination

* spelling: trying

* spelling: truncatable

* spelling: unknown

* spelling: undeployed

* spelling: unnecessary

* spelling: unparseable

* spelling: update

* spelling: upper

* spelling: verify

* spelling: visible

* spelling: warning

* spelling: we're

* spelling: whitespace

* spelling: wide

* spelling: with

* spelling: workspace

* spelling: yielding

* spelling: to

* spelling: by

* spelling: the

* spelling: hours
2017-02-12 13:38:30 +03:00
Oleg Nenashev 29893354a5 [JENKINS-23271] - Process statuses of Remote process join() operations directly inside methods (#2653)
* [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
2016-12-03 16:55:35 +01:00
Oleg Nenashev fd6c6aff92 [JENKINS-23271] - Prevent early deallocation of the Proc instance by GC in ProcStarter#join() (#2635)
* [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
2016-11-20 00:53:42 +01:00
Oliver Gondža 10cb11f9cd Describe pipeline aware alternative of deprecated method (#2452) 2016-07-14 10:36:00 +02:00
Antonio Muñiz 320e6c0702 Slave to Agent renaming - Javadocs and logs 2016-01-29 17:40:26 +01:00
Christopher Simons 7efb9090dd remove unused import statements
In addition to cluttering the namespace, unused imports generate
compiler warnings, introducing noise and obscuring more important
compiler warnings.  This change removes them.
2015-11-10 10:13:52 -05:00
David Hoover 1709ed3a2e Add @Deprecated annotations to things documented as @deprecated. 2015-04-19 14:50:12 -07:00
Jesse Glick 89cbfc4639 Merge branch 'SECURITY-144' into SECURITY-144-rc
Conflicts:
	core/src/main/java/hudson/EnvVars.java
	core/src/main/java/hudson/FilePath.java
	core/src/main/java/hudson/cli/ClientAuthenticationCache.java
	core/src/main/java/hudson/markup/MyspacePolicy.java
	core/src/main/java/hudson/model/Computer.java
	core/src/main/java/hudson/node_monitors/DiskSpaceMonitorDescriptor.java
	core/src/main/java/hudson/node_monitors/ResponseTimeMonitor.java
	core/src/main/java/hudson/node_monitors/TemporarySpaceMonitor.java
	core/src/main/java/hudson/security/AbstractPasswordBasedSecurityRealm.java
	core/src/main/java/hudson/slaves/Channels.java
	core/src/main/java/hudson/slaves/SlaveComputer.java
	core/src/main/java/hudson/tasks/Fingerprinter.java
	core/src/main/java/hudson/tasks/Shell.java
	core/src/main/java/hudson/tasks/junit/JUnitParser.java
	core/src/main/java/hudson/tasks/test/DefaultTestResultParserImpl.java
	core/src/main/java/hudson/util/ProcessTree.java
	core/src/main/java/hudson/util/RemotingDiagnostics.java
	core/src/main/java/jenkins/model/Jenkins.java
	core/src/test/java/hudson/LauncherTest.java
	pom.xml
	test/src/test/java/hudson/tasks/junit/CaseResultTest.java
2014-09-26 15:56:48 -04:00
Kohsuke Kawaguchi ffb5b65093 Switched from annotation based scheme to a function based scheme. 2014-09-23 19:12:43 -07:00
Kohsuke Kawaguchi 101b4e7fd5 [SECURITY-144] Classify all the core callables one way or the other 2014-09-18 15:07:31 -07:00
Kohsuke Kawaguchi 9009cccffb Updating to reflect changes made in remoting 2014-09-08 12:44:32 +01:00
Nicolas De loof 314bd64604 set @since on DecoratedLauncher 2014-09-02 12:04:12 +02:00
Jesse Glick 11ab9be6ef [FIXED JENKINS-23027] Added Launcher.ProcStarter.quiet option. 2014-08-08 14:29:40 -04:00
Oleg Nenashev ef943a3ee6 [FIXED JENKINS-20559] - ProcStarter: Check for null before cloning of environment variables list
Resolves https://issues.jenkins-ci.org/browse/JENKINS-20559
BTW, I also need to add some tests to "Test Harness" in order to improve coverage of nested operations.
These test require a fix for https://issues.jenkins-ci.org/browse/JENKINS-19454

Signed-off-by: Oleg Nenashev <nenashev@synopsys.com>
2014-06-01 14:48:53 +04:00
Oleg Nenashev a865a52562 [FIXED JENKINS-19454] - Added DecoratedLauncher implementation to the core.
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>
2014-06-01 14:48:44 +04:00
Kohsuke Kawaguchi a87f329b7e Channel.terminate() is now public 2014-04-04 18:07:25 -07:00
Kohsuke Kawaguchi 0b27f364f9 [JENKINS-22354]
Avoid having FilePath to depend on Jenkins, which increases the amount of classloading that has to happen during remoting
2014-04-03 20:17:24 -07:00
christ66 eabd1ba5ce Throw IOException if trying to launch a DummyLauncher. Restrict
DummyLauncher class to no external use.
2014-03-18 11:26:44 -07:00
christ66 d2a2ec589f [FIXED JENKINS-21999] If a slave node does not exist it will throw a
null pointer exception. Instead we create a dummy launcher and return
that if it is unable to get the slave node.
2014-02-28 14:46:28 -08:00
ikedam 4204d22496 [FIX JENKINS-20280] Calculates the order to override variables. This is an improved fix for [JENKINS-19488] and [JENKINS-19926]. 2013-10-26 13:38:30 -07:00
Vojtech Juranek b95f269452 [FIXED JENKINS-19926] Add only new env. variables
Previous patch (3eea396489) broke usescases when evn. variable overwrites already existing one
like PATH = $PATH:/my/path
2013-10-10 22:23:54 +02:00
Vojtech Juranek 3eea396489 [FIXED JENKINS-19488] Expand variable in a consistent way 2013-09-06 13:09:01 +02:00
Tim Lantz 656738c020 [JENKINS-18368] added isUnix override to launcher decorator classes so that isUnix is maintained for remote launcherswq 2013-06-16 23:23:49 -04:00
Jesse Glick 58484bb80c [FIXED JENKINS-15733] ArrayIndexOutOfBoundsException from Launcher due to misinterpretation of ProcStarter.envs in f5cebdc.
(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.)
2012-11-07 16:36:05 -05:00
Kohsuke Kawaguchi 0e8acc1507 these didn't make it into 1.488 2012-10-25 06:28:22 +09:00
Kohsuke Kawaguchi f5cebdc843 Added another decorator.
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
2012-10-25 03:03:04 +09:00
Jesse Glick 1f9ce5e4da Javadoc improvements inspired by “How to stop passwords used by my scm plugin from appearing the log?” on jenkinsci-dev. 2012-09-12 14:31:30 -04:00
Jesse Glick 2f128a77b2 Mangled Javadoc. 2012-07-15 11:31:40 -04:00