diff options
7 files changed, 43 insertions, 13 deletions
diff --git a/client/go/Makefile b/client/go/Makefile index fc1ac843917..1d995c7f5bf 100644 --- a/client/go/Makefile +++ b/client/go/Makefile @@ -99,6 +99,8 @@ ifeq ($(VERSION),$(DEVEL_VERSION)) $(error Invalid release version: $(VERSION). Try 'git checkout vX.Y.Z' or 'env VERSION=X.Y.Z make ...') endif +install-all: all manpages + # # Development targets # diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java index 95be59e4d26..d6d7de70ebc 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java @@ -346,16 +346,25 @@ public class SessionRepository { } public int deleteExpiredRemoteSessions(Clock clock, Duration expiryTime) { + List<Long> remoteSessionsFromZooKeeper = getRemoteSessionsFromZooKeeper(); + log.log(Level.FINE, () -> "Remote sessions for tenant " + tenantName + ": " + remoteSessionsFromZooKeeper); + int deleted = 0; - for (long sessionId : getRemoteSessionsFromZooKeeper()) { + for (long sessionId : remoteSessionsFromZooKeeper) { Session session = remoteSessionCache.get(sessionId); - if (session == null) continue; // Internal sessions not in sync with zk, continue + if (session == null) { + log.log(Level.FINE, () -> "Remote session " + sessionId + " is null, creating a new one"); + session = new RemoteSession(tenantName, sessionId, createSessionZooKeeperClient(sessionId)); + } if (session.getStatus() == Session.Status.ACTIVATE) continue; if (sessionHasExpired(session.getCreateTime(), expiryTime, clock)) { log.log(Level.FINE, () -> "Remote session " + sessionId + " for " + tenantName + " has expired, deleting it"); deleteRemoteSessionFromZooKeeper(session); deleted++; } + // Avoid deleting too many in one run + if (deleted > 100) + break; } return deleted; } diff --git a/dist/vespa.spec b/dist/vespa.spec index 1416109ab40..3c96c6b0ce1 100644 --- a/dist/vespa.spec +++ b/dist/vespa.spec @@ -542,7 +542,7 @@ mvn --batch-mode -e -N io.takari:maven:wrapper -Dmaven=3.6.3 . make %{_smp_mflags} -VERSION=%{version} make -C client/go +VERSION=%{version} make -C client/go install-all %endif %install @@ -553,6 +553,8 @@ cp -r %{installdir} %{buildroot} %else make install DESTDIR=%{buildroot} cp client/go/bin/vespa %{buildroot}%{_prefix}/bin/vespa +mkdir -p %{buildroot}/usr/share +cp -a client/go/share/* %{buildroot}/usr/share %endif # Otherwise installation may fail for find-debuginfo.sh/dwz: # dwz: dwz.c:9899: read_dwarf: Assertion `data != ((void *)0) && data->d_buf != ((void *)0)' failed. @@ -780,6 +782,8 @@ fi %{_prefix}/conf/vespa-feed-client/logging.properties %{_prefix}/lib/jars/vespa-http-client-jar-with-dependencies.jar %{_prefix}/lib/jars/vespa-feed-client-cli-jar-with-dependencies.jar +%docdir /usr/share/man +/usr/share/man %files config-model-fat %if %{_defattr_is_vespa_vespa} diff --git a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/ApplicationMetricsRetriever.java b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/ApplicationMetricsRetriever.java index 2ddbc71268c..80197758104 100644 --- a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/ApplicationMetricsRetriever.java +++ b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/ApplicationMetricsRetriever.java @@ -6,13 +6,13 @@ import ai.vespa.metricsproxy.metric.model.MetricsPacket; import ai.vespa.util.http.hc5.VespaAsyncHttpClientBuilder; import com.google.inject.Inject; import com.yahoo.component.AbstractComponent; -import org.apache.hc.client5.http.HttpHostConnectException; import org.apache.hc.client5.http.config.RequestConfig; import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient; import org.apache.hc.core5.reactor.IOReactorConfig; import org.apache.hc.core5.util.Timeout; import java.io.IOException; +import java.net.SocketException; import java.time.Clock; import java.time.Duration; import java.util.HashMap; @@ -71,8 +71,8 @@ public class ApplicationMetricsRetriever extends AbstractComponent implements Ru @Override public void run() { - try { - while (true) { + while (true) { + try { ConsumerId [] consumers; synchronized (pollThread) { consumers = consumerSet.toArray(new ConsumerId[0]); @@ -92,8 +92,12 @@ public class ApplicationMetricsRetriever extends AbstractComponent implements Ru pollThread.wait(timeUntilNextPoll.toMillis()); if (stopped) return; } + } catch (InterruptedException e) { + } catch (Exception e) { + log.log(Level.WARNING, "Got unknown exception:", e); } - } catch (InterruptedException e) {} + } + } @Override @@ -162,9 +166,8 @@ public class ApplicationMetricsRetriever extends AbstractComponent implements Ru if ((result != null) && result) numOk++; } catch (InterruptedException | ExecutionException | TimeoutException e) { Throwable cause = e.getCause(); - if ( e instanceof ExecutionException && (cause != null) && (cause instanceof HttpHostConnectException)) { - // Remove once we have some track time. - log.log(Level.WARNING, "Failed retrieving metrics for '" + entry.getKey() + "' : " + cause.getMessage()); + if ( e instanceof ExecutionException && (cause instanceof SocketException)) { + log.log(Level.FINE, "Failed retrieving metrics for '" + entry.getKey() + "' : " + cause.getMessage()); } else { log.log(Level.WARNING, "Failed retrieving metrics for '" + entry.getKey() + "' : ", e); } diff --git a/screwdriver.yaml b/screwdriver.yaml index 597f5f2678e..6ea74ae8a1d 100644 --- a/screwdriver.yaml +++ b/screwdriver.yaml @@ -139,7 +139,7 @@ jobs: cd $WORKDIR/vespa export FACTORY_VESPA_VERSION=$VESPA_VERSION NUM_THREADS=$(( $(nproc) + 2 )) - time make -C client/go BIN=$WORKDIR/vespa-install/opt/vespa/bin + time make -C client/go BIN=$WORKDIR/vespa-install/opt/vespa/bin SHARE=$WORKDIR/vespa-install/usr/share install-all time ./bootstrap.sh java time mvn -T $NUM_THREADS $VESPA_MAVEN_EXTRA_OPTS install cmake3 -DVESPA_UNPRIVILEGED=no . diff --git a/screwdriver/build-vespa.sh b/screwdriver/build-vespa.sh index 714f4972e12..f321e3820fd 100755 --- a/screwdriver/build-vespa.sh +++ b/screwdriver/build-vespa.sh @@ -40,10 +40,10 @@ case $SHOULD_BUILD in mvn -V $VESPA_MAVEN_EXTRA_OPTS install ;; go) - make -C client/go + make -C client/go install-all ;; *) - make -C client/go + make -C client/go install-all ./bootstrap.sh java time mvn -V $VESPA_MAVEN_EXTRA_OPTS install cmake3 -DVESPA_UNPRIVILEGED=no . diff --git a/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/VespaCliTestRunner.java b/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/VespaCliTestRunner.java index 8599babd0a5..45ceaa302e0 100644 --- a/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/VespaCliTestRunner.java +++ b/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/VespaCliTestRunner.java @@ -28,6 +28,7 @@ import static com.yahoo.vespa.testrunner.TestRunner.Status.ERROR; import static com.yahoo.vespa.testrunner.TestRunner.Status.FAILURE; import static com.yahoo.vespa.testrunner.TestRunner.Status.RUNNING; import static com.yahoo.vespa.testrunner.TestRunner.Status.SUCCESS; +import static com.yahoo.yolean.Exceptions.uncheck; import static java.nio.charset.StandardCharsets.UTF_8; /** @@ -42,6 +43,8 @@ public class VespaCliTestRunner implements TestRunner { private final Path testsPath; private final AtomicReference<Status> status = new AtomicReference<>(Status.NOT_STARTED); + private Path vespaCliHome = null; + @Inject public VespaCliTestRunner(VespaCliTestRunnerConfig config) { this(config.artifactsPath(), config.testsPath()); @@ -99,6 +102,14 @@ public class VespaCliTestRunner implements TestRunner { } } + private Path ensureHomeDirectoryForVespaCli() { + if (vespaCliHome == null) { + vespaCliHome = uncheck(() -> Files.createTempDirectory(VespaCliTestRunner.class.getSimpleName())); + vespaCliHome.toFile().deleteOnExit(); + } + return vespaCliHome; + } + ProcessBuilder testRunProcessBuilder(Suite suite, TestConfig config) throws IOException { Path suitePath = getChildDirectory(testsPath, toSuiteDirectoryName(suite)) .orElseThrow(() -> new IllegalStateException("No tests found, for suite '" + suite + "'")); @@ -107,6 +118,7 @@ public class VespaCliTestRunner implements TestRunner { "--application", config.application().toFullString(), "--zone", config.zone().value()); builder.redirectErrorStream(true); + builder.environment().put("VESPA_CLI_HOME", ensureHomeDirectoryForVespaCli().toString()); builder.environment().put("VESPA_CLI_ENDPOINTS", toEndpointsConfig(config)); builder.environment().put("VESPA_CLI_DATA_PLANE_KEY_FILE", artifactsPath.resolve("key").toAbsolutePath().toString()); builder.environment().put("VESPA_CLI_DATA_PLANE_CERT_FILE", artifactsPath.resolve("cert").toAbsolutePath().toString()); |