fix(scheduler): qualify SQL retry templates to fix multi-bean startup failure#1087
Open
bishnubista wants to merge 6 commits into
Open
fix(scheduler): qualify SQL retry templates to fix multi-bean startup failure#1087bishnubista wants to merge 6 commits into
bishnubista wants to merge 6 commits into
Conversation
v1r3n
approved these changes
May 14, 2026
4f3f1d7 to
b5dd80f
Compare
Author
|
@v1r3n Can you please review? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When the scheduler Postgres or MySQL persistence module is loaded alongside the full Conductor server context, startup can fail because multiple
RetryTemplatebeans are present: core'sonTransientErrorRetryTemplateand the DB-specificpostgresRetryTemplate/mysqlRetryTemplate. The schedulerSchedulerDAOandSchedulerArchivalDAOconstructors autowiredRetryTemplateby type, which is ambiguous and can cause aNoUniqueBeanDefinitionExceptionduring context refresh.This change qualifies the constructor parameters in both scheduler persistence modules so the correct DB-specific retry template is injected:
PostgresSchedulerConfiguration:schedulerDAOandschedulerArchivalDAOnow require@Qualifier("postgresRetryTemplate").MySQLSchedulerConfiguration:schedulerDAOandschedulerArchivalDAOnow require@Qualifier("mysqlRetryTemplate").The shared smoke-test fixture now reproduces the multi-bean context by registering core's
onTransientErrorRetryTemplateplus each DB-specific retry template. The tests assert bothSchedulerDAOandSchedulerArchivalDAOare created with the expected concrete classes and verify both DAOs hold the DB-specificRetryTemplateinstance.Testing
Fail-first verified before applying the production fix: both smoke tests failed with two
RetryTemplatebeans (onTransientErrorRetryTemplatepluspostgresRetryTemplate/mysqlRetryTemplate). After the fix:Docker Compose validation with Postgres:
YARN_OPTS='--network-timeout 10000000' docker compose -f docker/docker-compose-postgres.yaml up -d --buildconductor-serverandconductor-postgresreached healthy state.curl http://localhost:8000/healthreturned HTTP 200 withhealthy=true.scheduler,scheduler_execution, andscheduler_next_runtables, andflyway_schema_history_schedulershowed successful rows for the baseline plus migrations 1 and 2./api/scheduler/schedulesreturned 404 in the vanilla compose setup, so Docker verification was scoped to the scheduler persistence auto-configuration path via migrations and tables rather than scheduler HTTP calls.docker compose -f docker/docker-compose-postgres.yaml down -v.Fixes
Fixes #1084