Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data store: fix incorrect task state #5650

Merged
merged 6 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes.d/5650.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug preventing clean-up of finished tasks in the GUI and TUI.
28 changes: 14 additions & 14 deletions cylc/flow/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1755,10 +1755,11 @@ async def main_loop(self) -> None:
self.timers[self.EVENT_RESTART_TIMEOUT].stop()
self.is_restart_timeout_wait = False

if has_updated:
if has_updated or self.data_store_mgr.updates_pending:
# Update the datastore.
await self.update_data_structure(self.is_reloaded)

if has_updated:
wxtim marked this conversation as resolved.
Show resolved Hide resolved
if not self.is_reloaded:
# (A reload cannot un-stall workflow by itself)
self.is_stalled = False
Expand All @@ -1774,6 +1775,8 @@ async def main_loop(self) -> None:
with suppress(KeyError):
self.timers[self.EVENT_STALL_TIMEOUT].stop()

self.update_data_store()
wxtim marked this conversation as resolved.
Show resolved Hide resolved

self.process_workflow_db_queue()

# If public database is stuck, blast it away by copying the content
Expand Down Expand Up @@ -1846,21 +1849,18 @@ def _update_workflow_state(self):

async def update_data_structure(self, reloaded: bool = False):
"""Update DB, UIS, Summary data elements"""
# Add tasks that have moved from runahead to live pool.
if self.data_store_mgr.updates_pending:
# Collect/apply data store updates/deltas
self.data_store_mgr.update_data_structure(reloaded=reloaded)
# Publish updates:
if self.data_store_mgr.publish_pending:
self.data_store_mgr.publish_pending = False
self.server.publish_queue.put(
self.data_store_mgr.publish_deltas)
# Non-async sleep - yield to other threads rather
# than event loop
sleep(0)
# Collect/apply data store updates/deltas
self.data_store_mgr.update_data_structure(reloaded=reloaded)
# Publish updates:
if self.data_store_mgr.publish_pending:
self.data_store_mgr.publish_pending = False
self.server.publish_queue.put(
self.data_store_mgr.publish_deltas)
# Non-async sleep - yield to other threads rather
# than event loop
sleep(0)
# Database update
self.workflow_db_mgr.put_task_pool(self.pool)
self.update_data_store()
wxtim marked this conversation as resolved.
Show resolved Hide resolved

def check_workflow_timers(self):
"""Check timers, and abort or run event handlers as configured."""
Expand Down
Loading