Skip to content

Commit

Permalink
JENKINS-62006 Fix a classloading issue while executing ProcessTree.ge…
Browse files Browse the repository at this point in the history
…t() (#5367)

* JENKINS-62006 Check if agent before master, fix remoting classloading
error

* Use JenkinsJVM API
  • Loading branch information
timja authored Mar 22, 2021
1 parent 43dbc8f commit e2837f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/jenkins/agents/AgentComputerUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import hudson.FilePath;
import hudson.remoting.Channel;
import hudson.remoting.VirtualChannel;
import jenkins.model.Jenkins;
import jenkins.util.JenkinsJVM;

public final class AgentComputerUtil {
private AgentComputerUtil() {
Expand All @@ -45,7 +45,7 @@ private AgentComputerUtil() {
*/
@CheckForNull
public static VirtualChannel getChannelToMaster() {
if (Jenkins.getInstanceOrNull() != null) {// check if calling thread is on master or on agent
if (JenkinsJVM.isJenkinsJVM()) {
return FilePath.localChannel;
}

Expand Down

0 comments on commit e2837f8

Please sign in to comment.