Skip to content

Commit

Permalink
fix: improve core start up behavior (#2527)
Browse files Browse the repository at this point in the history
* fix: improve core start up behavior

* fix: remove duplicate file headers
  • Loading branch information
bossenti authored Mar 11, 2024
1 parent d301ea4 commit 8dcf5f5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ public Map<String, AdapterDescription> getAdaptersToRecover(
adapterDescription.getElementId()));
} catch (AdapterException e) {
LOG.info(
"Could not recover adapter at endpoint {} due to {}",
"Could not recover adapter at endpoint {} - "
+ "marking it as requested to recover (reason: {})",
adapterEndpointUrl,
e.getMessage()
);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.apache.streampipes.manager.health.CoreInitialInstallationProgress;
import org.apache.streampipes.manager.health.CoreServiceStatusManager;
import org.apache.streampipes.manager.health.ServiceRegistrationManager;
import org.apache.streampipes.manager.migration.AdapterDescriptionMigration093;
import org.apache.streampipes.manager.migration.PipelineElementMigrationManager;
import org.apache.streampipes.model.extensions.svcdiscovery.SpServiceRegistration;
import org.apache.streampipes.model.extensions.svcdiscovery.SpServiceStatus;
Expand Down Expand Up @@ -64,8 +63,6 @@ public class MigrationResource extends AbstractAuthGuardedRestResource {

private final CRUDStorage<String, SpServiceRegistration> extensionsServiceStorage =
getNoSqlStorage().getExtensionsServiceStorage();

private final IAdapterStorage adapterDescriptionStorage = getNoSqlStorage().getAdapterDescriptionStorage();
private final IAdapterStorage adapterStorage = getNoSqlStorage().getAdapterInstanceStorage();

private final IDataProcessorStorage dataProcessorStorage = getNoSqlStorage().getDataProcessorStorage();
Expand Down Expand Up @@ -104,13 +101,12 @@ public ResponseEntity<Void> performMigrations(
try {
var extensionsServiceConfig = serviceManager.getService(serviceId);
if (!CoreInitialInstallationProgress.INSTANCE.isInitiallyInstalling()) {
new AdapterDescriptionMigration093(adapterDescriptionStorage).reinstallAdapters(extensionsServiceConfig);
if (!migrationConfigs.isEmpty()) {
var anyServiceMigrating = serviceManager.isAnyServiceMigrating();
var coreReady = isCoreReady();
if (anyServiceMigrating || !coreReady) {
LOG.info(
"Refusing migration request since precondition is not met (anyServiceMigratione={}, coreReady={}.",
"Refusing migration request since precondition is not met (anyServiceMigrating={}, coreReady={}.",
anyServiceMigrating,
coreReady
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import org.apache.streampipes.commons.prometheus.adapter.AdapterMetricsManager;
import org.apache.streampipes.connect.management.management.WorkerAdministrationManagement;
import org.apache.streampipes.manager.health.ServiceHealthCheck;
import org.apache.streampipes.manager.operations.Operations;
import org.apache.streampipes.model.extensions.svcdiscovery.SpServiceTagPrefix;
import org.apache.streampipes.model.pipeline.Pipeline;
Expand Down Expand Up @@ -65,6 +66,7 @@ public PostStartupTask(IPipelineStorage pipelineStorage) {

@Override
public void run() {
new ServiceHealthCheck().run();
performAdapterAssetUpdate();
startAllPreviouslyStoppedPipelines();
startAdapters();
Expand Down

0 comments on commit 8dcf5f5

Please sign in to comment.