Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
amuniz committed May 28, 2024
1 parent b65787a commit 3b78a0b
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
Expand All @@ -68,7 +67,7 @@ public class KubernetesLauncher extends JNLPLauncher {

private static final Logger LOGGER = Logger.getLogger(KubernetesLauncher.class.getName());

private final AtomicBoolean launched = new AtomicBoolean(false);
private volatile boolean launched = false;

/**
* Provisioning exception if any.
Expand All @@ -87,7 +86,7 @@ public KubernetesLauncher() {

@Override
public boolean isLaunchSupported() {
return !launched.get();
return !launched;
}

@Override
Expand All @@ -104,7 +103,7 @@ public synchronized void launch(SlaveComputer computer, TaskListener listener) {
if (node == null) {
throw new IllegalStateException("Node has been removed, cannot launch " + computer.getName());
}
if (launched.get()) {
if (launched) {
LOGGER.log(INFO, "Agent has already been launched, activating: {0}", node.getNodeName());
computer.setAcceptingTasks(true);
return;
Expand Down Expand Up @@ -288,7 +287,7 @@ public synchronized void launch(SlaveComputer computer, TaskListener listener) {
}

computer.setAcceptingTasks(true);
launched.set(true);
launched = true;
try {
// We need to persist the "launched" setting...
node.save();
Expand Down

0 comments on commit 3b78a0b

Please sign in to comment.