Skip to content

Commit

Permalink
addressing few test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
nsivabalan committed Nov 22, 2023
1 parent e29aeab commit 597f6d7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@ private static EmbeddedTimelineService createAndStartService(HoodieEngineContext
return service;
}

public static void shutdownAllTimelineServers() {
RUNNING_SERVICES.entrySet().forEach(entry -> {
LOG.info("Closing Timeline server");
entry.getValue().server.close();
METRICS_REGISTRY.set(NUM_EMBEDDED_TIMELINE_SERVERS, NUM_SERVERS_RUNNING.decrementAndGet());
LOG.info("Closed Timeline server");
});
RUNNING_SERVICES.clear();
}

private FileSystemViewManager createViewManager() {
// Using passed-in configs to build view storage configs
FileSystemViewStorageConfig.Builder builder =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.hudi.sink;

import org.apache.hudi.client.HoodieFlinkWriteClient;
import org.apache.hudi.client.embedded.EmbeddedTimelineService;
import org.apache.hudi.common.model.HoodieFailedWritesCleaningPolicy;
import org.apache.hudi.common.model.HoodieKey;
import org.apache.hudi.common.model.HoodieTableType;
Expand Down Expand Up @@ -73,6 +74,7 @@ public void before() {
@AfterEach
public void after() {
conf = null;
EmbeddedTimelineService.shutdownAllTimelineServers();
}

/**
Expand Down Expand Up @@ -617,6 +619,7 @@ public void testWriteMultiWriterPartialOverlapping(WriteConcurrencyMode writeCon
@Test
public void testReuseEmbeddedServer() throws IOException {
conf.setInteger("hoodie.filesystem.view.remote.timeout.secs", 500);
conf.setString("hoodie.metadata.enable","true");
HoodieFlinkWriteClient writeClient = FlinkWriteClients.createWriteClient(conf);
FileSystemViewStorageConfig viewStorageConfig = writeClient.getConfig().getViewStorageConfig();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import org.apache.hudi.avro.AvroSchemaUtils.{isCompatibleProjectionOf, isSchemaC
import org.apache.hudi.avro.HoodieAvroUtils
import org.apache.hudi.avro.HoodieAvroUtils.removeMetadataFields
import org.apache.hudi.client.common.HoodieSparkEngineContext
import org.apache.hudi.client.embedded.EmbeddedTimelineService
import org.apache.hudi.client.{HoodieWriteResult, SparkRDDWriteClient}
import org.apache.hudi.commit.{DatasetBulkInsertCommitActionExecutor, DatasetBulkInsertOverwriteCommitActionExecutor, DatasetBulkInsertOverwriteTableCommitActionExecutor}
import org.apache.hudi.common.config._
Expand Down Expand Up @@ -821,6 +822,7 @@ class HoodieSparkSqlWriterInternal {
log.info("Closing write client")
writeClient.close()
}
EmbeddedTimelineService.shutdownAllTimelineServers()
}
}

Expand Down

0 comments on commit 597f6d7

Please sign in to comment.