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: remove threading #574

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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/574.break.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove the `max_threads` configuration as this is no longer needed.
1 change: 1 addition & 0 deletions changes.d/574.feat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed the need for threading in the Cylc UI Server, this removes the artificial workflow limit.
24 changes: 8 additions & 16 deletions cylc/uiserver/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,16 +327,6 @@ class CylcUIServer(ExtensionApp):
''',
default_value=1
)
max_threads = Int(
config=True,
help='''
Set the maximum number of threads the Cylc UI Server can use.

This determines the maximum number of active workflows that the
server can track.
''',
default_value=100,
)
profile = Bool(
config=True,
help='''
Expand Down Expand Up @@ -410,7 +400,6 @@ def __init__(self, *args, **kwargs):
self.data_store_mgr = DataStoreMgr(
self.workflows_mgr,
self.log,
self.max_threads,
)
# sub_status dictionary storing status of subscriptions
self.sub_statuses = {}
Expand Down Expand Up @@ -450,10 +439,16 @@ def initialize_settings(self):
)
self.profiler.start()

# start up the data store manager update task
ioloop.IOLoop.current().add_callback(
self.data_store_mgr.startup
)

# start the async scan task running (do this on server start not init)
ioloop.IOLoop.current().add_callback(
self.workflows_mgr.run
)

# configure the scan interval
ioloop.PeriodicCallback(
self.workflows_mgr.scan,
Expand Down Expand Up @@ -571,12 +566,9 @@ def launch_instance(cls, argv=None, workflow_id=None, **kwargs):
del os.environ["JUPYTER_RUNTIME_DIR"]

async def stop_extension(self):
self.profiler.stop()
# stop the async scan task
await self.workflows_mgr.stop()
for sub in self.data_store_mgr.w_subs.values():
sub.stop()
# Shutdown the thread pool executor
self.data_store_mgr.executor.shutdown(wait=False)
self.data_store_mgr.shutdown()
# Destroy ZeroMQ context of all sockets
self.workflows_mgr.context.destroy()
self.profiler.stop()
Loading