There's an artificial limit to the number of workflows that will update in the GUI based on the number of cores on the system.
Instructions to reproduce:
Install and start a workflow.
Navigate to it in the tree view.
Leave this workflow running and goto (1).
Repeat the above instructions enough times and you will eventually end up with a workflow that does not update. The tree view will show the initial tasks in the workflow, but the workflow itself could be many cycles ahead of this state.
The number of repetitions of the above instructions required to replicate the bug is the number of virtual CUP cores on your system plus 5.
Cause
We are using a TheadPoolExecutor to manage workflow subscriptions in threads:
There's an artificial limit to the number of workflows that will update in the GUI based on the number of cores on the system.
Instructions to reproduce:
Repeat the above instructions enough times and you will eventually end up with a workflow that does not update. The tree view will show the initial tasks in the workflow, but the workflow itself could be many cycles ahead of this state.
The number of repetitions of the above instructions required to replicate the bug is the number of virtual CUP cores on your system plus 5.
Cause
We are using a
TheadPoolExecutor
to manage workflow subscriptions in threads:https://github.com/cylc/cylc-uiserver/blob/49fa3ef27186b7dcf86aef0aacfe09048f620d5a/cylc/uiserver/data_store_mgr.py#L90
https://github.com/cylc/cylc-uiserver/blob/49fa3ef27186b7dcf86aef0aacfe09048f620d5a/cylc/uiserver/data_store_mgr.py#L150-L156
But, we don't specify the maximum number of threads so we get the default which is the number of virtual cores on the machine plus 4:
https://docs.python.org/3/library/concurrent.futures.html#threadpoolexecutor
So on a dual core machine (2 physical cores = 4 virtual cores) the maximum number of workflows that will update is 8! Ouch!
Solutions