Skip to content

Remove deprecated Tornado current-loop APIs in WebGL server thread - #647

Draft
kroq-gar78 with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-tornado-warnings
Draft

Remove deprecated Tornado current-loop APIs in WebGL server thread#647
kroq-gar78 with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-tornado-warnings

Conversation

CopilotAI commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

This change removes Tornado deprecation warnings emitted by cortex/webgl/serve.py when running WebGL/headless tests. WebApp.run() previously used deprecated current-loop mutation methods (clear_current / make_current).

  • Runtime loop initialization

    • WebApp.run() now gets the thread-local loop via tornado.ioloop.IOLoop.current() instead of constructing an IOLoop and mutating global current-loop state.
    • Existing server startup flow remains the same (ApplicationHTTPServerlistenstart).
  • Focused regression coverage

    • Added cortex/tests/test_webgl_serve.py with a targeted test that monkeypatches IOLoop.current() and asserts WebApp uses that loop for startup.
defrun(self):
ioloop: tornado.ioloop.IOLoop=tornado.ioloop.IOLoop.current()
self.ioloop=ioloopapplication=tornado.web.Application(self.handlers, gzip=True)
...
self.server.listen(self.port)
ioloop.start()
Original prompt

Fix these two tornado warnings in cortex/webgl/serve.py:

cortex/tests/test_export.py: 2warningscortex/tests/test_headless.py: 3warningscortex/tests/test_webgl_headless.py: 23warnings/home/runner/work/pycortex/pycortex/cortex/webgl/serve.py:327: DeprecationWarning: clear_currentisdeprecatedioloop.clear_current()
cortex/tests/test_export.py: 2warningscortex/tests/test_headless.py: 3warningscortex/tests/test_webgl_headless.py: 23warnings/home/runner/work/pycortex/pycortex/cortex/webgl/serve.py:328: DeprecationWarning: make_currentisdeprecated; starttheeventloopfirstioloop.make_current()

Created from VS Code.

CopilotAI changed the title [WIP] Fix tornado warnings in serve.py for deprecationRemove deprecated Tornado current-loop APIs in WebGL server threadJun 2, 2026
CopilotAI requested a review from kroq-gar78June 2, 2026 03:08
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@kroq-gar78