FINERACT-2181: Liquibase migrations are stuck when multi-threaded migrations are enabled and one tenant migration fails

This commit is contained in:
Arnold Galovics
2025-03-06 19:36:34 +01:00
committed by Arnold Gálovics
parent f8e5d6c9fc
commit 7b45f3e4d5
2 changed files with 13 additions and 7 deletions
@@ -40,7 +40,6 @@ import org.apache.fineract.infrastructure.core.config.FineractProperties;
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
import org.apache.fineract.infrastructure.core.service.migration.ExtendedSpringLiquibase;
import org.apache.fineract.infrastructure.core.service.migration.ExtendedSpringLiquibaseFactory;
import org.apache.fineract.infrastructure.core.service.migration.SchemaUpgradeNeededException;
import org.apache.fineract.infrastructure.core.service.migration.TenantDataSourceFactory;
import org.apache.fineract.infrastructure.core.service.migration.TenantDatabaseStateVerifier;
import org.apache.fineract.infrastructure.core.service.migration.TenantDatabaseUpgradeService;
@@ -66,7 +65,7 @@ public class LiquibaseStepDefinitions implements En {
private DataSource tenantStoreDataSource;
private TenantDatabaseUpgradeService tenantDatabaseUpgradeService;
private List<FineractPlatformTenant> allTenants;
private SchemaUpgradeNeededException executionException;
private RuntimeException executionException;
private HikariDataSource defaultTenantDataSource;
private Environment environment;
@@ -103,10 +102,8 @@ public class LiquibaseStepDefinitions implements En {
When("The database migration process is executed", () -> {
try {
tenantDatabaseUpgradeService.afterPropertiesSet();
} catch (SchemaUpgradeNeededException e) {
executionException = e;
} catch (RuntimeException e) {
executionException = (SchemaUpgradeNeededException) e.getCause().getCause();
executionException = e;
}
});