Clean up sync scheduling (#15043)
It's possible for the scheduler to get in a weird state if the sync fails while it executes. This change makes it *only* recreate a job/task if the schedule has changed or if it is missing. Previously, clearing the state at every start had bad effects if the JVM had terminated during the sync. Adds a vector of Exception classes that signal a "fatal" exception during sync for a specific database. If these exceptions occur, the sync for that database stops and will pick up next time. This will have to be expanded per driver, but I don't see a way around that, as each driver will have its own, unique way of failing. metabase/metabase#14817
Showing
- .circleci/config.yml 1 addition, 1 deletion.circleci/config.yml
- frontend/test/__runner__/test_db_fixture.db.mv.db 0 additions, 0 deletionsfrontend/test/__runner__/test_db_fixture.db.mv.db
- resources/quartz.properties 1 addition, 11 deletionsresources/quartz.properties
- src/metabase/models/database.clj 1 addition, 1 deletionsrc/metabase/models/database.clj
- src/metabase/models/task_history.clj 9 additions, 1 deletionsrc/metabase/models/task_history.clj
- src/metabase/sync/sync_metadata/sync_timezone.clj 9 additions, 16 deletionssrc/metabase/sync/sync_metadata/sync_timezone.clj
- src/metabase/sync/util.clj 32 additions, 6 deletionssrc/metabase/sync/util.clj
- src/metabase/task.clj 9 additions, 8 deletionssrc/metabase/task.clj
- src/metabase/task/sync_databases.clj 35 additions, 15 deletionssrc/metabase/task/sync_databases.clj
- src/metabase/util.clj 6 additions, 1 deletionsrc/metabase/util.clj
- test/metabase/sync/sync_metadata/sync_timezone_test.clj 0 additions, 24 deletionstest/metabase/sync/sync_metadata/sync_timezone_test.clj
- test/metabase/sync/util_test.clj 57 additions, 0 deletionstest/metabase/sync/util_test.clj
- test/metabase/task/sync_databases_test.clj 7 additions, 7 deletionstest/metabase/task/sync_databases_test.clj
Loading
Please register or sign in to comment