Skip to content

Commit

Permalink
Launch Liquibase operations only when Arc is ready
Browse files Browse the repository at this point in the history
This avoids a race condition with the AppCDS generation process.

Fixes: quarkusio#33843
(cherry picked from commit e15e6c1)
  • Loading branch information
geoand authored and gsmet committed Jun 14, 2023
1 parent 4f903ad commit a51f206
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import org.jboss.jandex.DotName;
import org.jboss.logging.Logger;

import io.quarkus.arc.deployment.BeanContainerBuildItem;
import io.quarkus.arc.deployment.SyntheticBeanBuildItem;
import io.quarkus.arc.deployment.SyntheticBeansRuntimeInitBuildItem;
import io.quarkus.deployment.Feature;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
Expand Down Expand Up @@ -245,7 +245,7 @@ void createBeans(LiquibaseMongodbRecorder recorder,

@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
@Consume(SyntheticBeansRuntimeInitBuildItem.class)
@Consume(BeanContainerBuildItem.class)
ServiceStartBuildItem startLiquibase(LiquibaseMongodbRecorder recorder,
BuildProducer<InitTaskCompletedBuildItem> initializationCompleteBuildItem) {
// will actually run the actions at runtime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import io.quarkus.agroal.spi.JdbcDataSourceBuildItem;
import io.quarkus.agroal.spi.JdbcDataSourceSchemaReadyBuildItem;
import io.quarkus.arc.deployment.AdditionalBeanBuildItem;
import io.quarkus.arc.deployment.BeanContainerBuildItem;
import io.quarkus.arc.deployment.SyntheticBeanBuildItem;
import io.quarkus.arc.deployment.SyntheticBeansRuntimeInitBuildItem;
import io.quarkus.arc.processor.DotNames;
import io.quarkus.datasource.common.runtime.DataSourceUtil;
import io.quarkus.deployment.Feature;
Expand Down Expand Up @@ -303,7 +303,7 @@ void createBeans(LiquibaseRecorder recorder,

@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
@Consume(SyntheticBeansRuntimeInitBuildItem.class)
@Consume(BeanContainerBuildItem.class)
ServiceStartBuildItem startLiquibase(LiquibaseRecorder recorder,
List<JdbcDataSourceBuildItem> jdbcDataSourceBuildItems,
BuildProducer<InitTaskCompletedBuildItem> initializationCompleteBuildItem,
Expand Down

0 comments on commit a51f206

Please sign in to comment.