Skip to content

Commit

Permalink
main loop: revert merging of db lock check with health check
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-sanders committed Mar 31, 2020
1 parent 99afeae commit dff4db8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 0 additions & 8 deletions cylc/flow/main_loop/health_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* Ensures suite run directory is still present.
* Ensures contact file is present and consistent with the running suite.
* Unstick the public database if locked.
Shuts down the suite in the enent of inconsistency or error.
Expand All @@ -35,9 +34,6 @@ async def during(scheduler, _):
# 2. check if contact file consistent with current start - if not
# shutdown.
_check_contact_file(scheduler)
# 3. If public database is stuck, blast it away by copying the content
# of the private database into it.
_check_database(scheduler)


def _check_suite_run_dir(scheduler):
Expand All @@ -59,7 +55,3 @@ def _check_contact_file(scheduler):
'%s: contact file corrupted/modified and may be left'
% suite_files.get_contact_file(scheduler.suite)
)


def _check_database(scheduler):
scheduler.suite_db_mgr.recover_pub_from_pri()
9 changes: 9 additions & 0 deletions cylc/flow/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,11 @@ def process_suite_db_queue(self):
"""Update suite DB."""
self.suite_db_mgr.process_queued_ops()

def database_health_check(self):
"""If public database is stuck, blast it away by copying the content
of the private database into it."""
self.suite_db_mgr.recover_pub_from_pri()

def late_tasks_check(self):
"""Report tasks that are never active and are late."""
now = time()
Expand Down Expand Up @@ -1526,6 +1531,10 @@ async def main_loop(self):

self.process_suite_db_queue()

# If public database is stuck, blast it away by copying the content
# of the private database into it.
self.database_health_check()

# Shutdown suite if timeouts have occurred
self.timeout_check()

Expand Down

0 comments on commit dff4db8

Please sign in to comment.