Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#11221] fix(bin): Scope launcher PID lookup by home (#11222)

Qi Yu0bef4f0553fa
diff --git a/.github/workflows/backend-integration-test-action.yml b/.github/workflows/backend-integration-test-action.yml
index 09992506b1..0c507fc25c 100644
--- a/.github/workflows/backend-integration-test-action.yml
+++ b/.github/workflows/backend-integration-test-action.yml
@@ -30,7 +30,7 @@ jobs:
start-runner:
name: JDK${{ inputs.java-version }}-${{ inputs.test-mode }}-${{ inputs.backend }}
runs-on: ubuntu-22.04
- timeout-minutes: 90
+ timeout-minutes: 120
env:
PLATFORM: ${{ inputs.architecture }}
steps:
diff --git a/bin/gravitino-iceberg-rest-server.sh.template b/bin/gravitino-iceberg-rest-server.sh.template
index 1c87a3a72a..df26c3e812 100755
--- a/bin/gravitino-iceberg-rest-server.sh.template
+++ b/bin/gravitino-iceberg-rest-server.sh.template
@@ -54,7 +54,9 @@ function check_process_status() {
function found_iceberg_rest_server_pid() {
process_name='GravitinoIcebergRESTServer';
- RUNNING_PIDS=$(ps x | grep ${process_name} | grep -v grep | awk '{print $1}');
+ RUNNING_PIDS=$(
+ ps xww | grep -F "${process_name}" | grep -F "${GRAVITINO_HOME}" | grep -v grep | awk '{print $1}'
+ );
if [[ -z "${RUNNING_PIDS}" ]]; then
return
diff --git a/bin/gravitino-lance-rest-server.sh.template b/bin/gravitino-lance-rest-server.sh.template
index d0883a1536..87f6f1deb4 100644
--- a/bin/gravitino-lance-rest-server.sh.template
+++ b/bin/gravitino-lance-rest-server.sh.template
@@ -54,7 +54,9 @@ function check_process_status() {
function found_lance_rest_server_pid() {
process_name='GravitinoLanceRESTServer';
- RUNNING_PIDS=$(ps x | grep ${process_name} | grep -v grep | awk '{print $1}');
+ RUNNING_PIDS=$(
+ ps xww | grep -F "${process_name}" | grep -F "${GRAVITINO_HOME}" | grep -v grep | awk '{print $1}'
+ );
if [[ -z "${RUNNING_PIDS}" ]]; then
return
diff --git a/bin/gravitino.sh.template b/bin/gravitino.sh.template
index 259694b570..d6ca1a8957 100755
--- a/bin/gravitino.sh.template
+++ b/bin/gravitino.sh.template
@@ -54,7 +54,9 @@ function check_process_status() {
function found_gravitino_server_pid() {
process_name='GravitinoServer';
- RUNNING_PIDS=$(ps x | grep ${process_name} | grep -v grep | awk '{print $1}');
+ RUNNING_PIDS=$(
+ ps xww | grep -F "${process_name}" | grep -F "${GRAVITINO_HOME}" | grep -v grep | awk '{print $1}'
+ );
if [[ -z "${RUNNING_PIDS}" ]]; then
return
diff --git a/core/src/main/java/org/apache/gravitino/stats/storage/LancePartitionStatisticStorage.java b/core/src/main/java/org/apache/gravitino/stats/storage/LancePartitionStatisticStorage.java
index ec2579f7a7..5755d1bd56 100644
--- a/core/src/main/java/org/apache/gravitino/stats/storage/LancePartitionStatisticStorage.java
+++ b/core/src/main/java/org/apache/gravitino/stats/storage/LancePartitionStatisticStorage.java
@@ -21,6 +21,7 @@ package org.apache.gravitino.stats.storage;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
+import com.github.benmanes.caffeine.cache.RemovalCause;
import com.github.benmanes.caffeine.cache.RemovalListener;
import com.github.benmanes.caffeine.cache.Scheduler;
import com.google.common.annotations.VisibleForTesting;
@@ -207,7 +208,7 @@ public class LancePartitionStatisticStorage implements PartitionStatisticStorage
.removalListener(
(RemovalListener<Long, DatasetHolder>)
(key, value, cause) -> {
- if (value != null) {
+ if (value != null && cause != RemovalCause.EXPLICIT) {
closeDatasetHolder(value);
}
})
diff --git a/core/src/test/java/org/apache/gravitino/stats/storage/TestLancePartitionStatisticStorage.java b/core/src/test/java/org/apache/gravitino/stats/storage/TestLancePartitionStatisticStorage.java
index 5a6ae16e98..79d3525700 100644
--- a/core/src/test/java/org/apache/gravitino/stats/storage/TestLancePartitionStatisticStorage.java
+++ b/core/src/test/java/org/apache/gravitino/stats/storage/TestLancePartitionStatisticStorage.java
@@ -662,6 +662,12 @@ public class TestLancePartitionStatisticStorage {
properties.put("location", location);
properties.put("datasetCacheSize", "10");
+ EntityStore entityStore = mock(EntityStore.class);
+ TableEntity tableEntity = mock(TableEntity.class);
+ when(entityStore.get(any(), any(), any())).thenReturn(tableEntity);
+ when(tableEntity.id()).thenReturn(1L);
+ FieldUtils.writeField(GravitinoEnv.getInstance(), "entityStore", entityStore, true);
+
LancePartitionStatisticStorage storage = new LancePartitionStatisticStorage(properties);
try {
diff --git a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/util/IcebergRESTServerManagerForDeploy.java b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/util/IcebergRESTServerManagerForDeploy.java
index 943acde5c7..c283a19d2a 100644
--- a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/util/IcebergRESTServerManagerForDeploy.java
+++ b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/util/IcebergRESTServerManagerForDeploy.java
@@ -94,6 +94,10 @@ public class IcebergRESTServerManagerForDeploy extends IcebergRESTServerManager
@Override
public void doStopIcebergRESTServer() {
String cmd = String.format("%s/bin/%s stop", icebergRESTServerHome.toString(), SCRIPT_NAME);
- CommandExecutor.executeCommandLocalHost(cmd, false, TypesOfData.ERROR);
+ CommandExecutor.executeCommandLocalHost(
+ cmd,
+ false,
+ TypesOfData.ERROR,
+ ImmutableMap.of("GRAVITINO_HOME", icebergRESTServerHome.toString()));
}
}