Remove node-admin locks
package com.yahoo.vespa.hosted.node.admin.provider;
import com.google.inject.Inject;
-import com.yahoo.concurrent.lock.Lock;
-import com.yahoo.concurrent.lock.Locking;
import com.yahoo.container.di.componentgraph.Provider;
import com.yahoo.log.LogLevel;
import com.yahoo.net.HostName;
@@ -46,15 +44,11 @@ public class NodeAdminProvider implements Provider<NodeAdminStateUpdater> {
private final Logger log = Logger.getLogger(NodeAdminProvider.class.getName());
private final NodeAdminStateUpdater nodeAdminStateUpdater;
- private final Lock classLock;
@Inject
- public NodeAdminProvider(Docker docker, MetricReceiverWrapper metricReceiver, Locking locking) {
- log.log(LogLevel.INFO, objectToString() + ": Creating object, acquiring lock...");
- classLock = locking.lock(this.getClass());
+ public NodeAdminProvider(Docker docker, MetricReceiverWrapper metricReceiver) {
+ log.log(LogLevel.INFO, objectToString() + ": Creating object");
try {
- log.log(LogLevel.INFO, objectToString() + ": Lock acquired");
-
Clock clock = Clock.systemUTC();
String dockerHostHostName = HostName.getLocalhost();
ProcessExecuter processExecuter = new ProcessExecuter();
@@ -78,7 +72,6 @@ public class NodeAdminProvider implements Provider<NodeAdminStateUpdater> {
dockerHostHostName, clock, NODE_ADMIN_CONVERGE_STATE_INTERVAL);
nodeAdminStateUpdater.start();
} catch (Exception e) {
- classLock.close();
throw e;
}
}
@@ -94,9 +87,6 @@ public class NodeAdminProvider implements Provider<NodeAdminStateUpdater> {
nodeAdminStateUpdater.stop();
log.log(LogLevel.INFO, objectToString() + ": Stop complete");
-
- classLock.close();
- log.log(LogLevel.INFO, objectToString() + ": Lock released");
}
private String objectToString() {
