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

Starting a viewer in a separate thread with multiprocessing fails with tornado 6.0.3 #351

Open
mvdoc opened this issue Dec 6, 2019 · 0 comments
Assignees

Comments

@mvdoc
Copy link
Contributor

mvdoc commented Dec 6, 2019

It works with tornado 4.3. This comes from our realtimefmri pipeline. The error appears before the client can connect. Traceback:

realtimefmri_1_96c86fa3cd6a | Started server on port 8051
realtimefmri_1_96c86fa3cd6a | <IPython.core.display.HTML object>
realtimefmri_1_96c86fa3cd6a | Process Process-5:
realtimefmri_1_96c86fa3cd6a | Traceback (most recent call last):
realtimefmri_1_96c86fa3cd6a |   File "/usr/local/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
realtimefmri_1_96c86fa3cd6a |     self.run()
realtimefmri_1_96c86fa3cd6a |   File "/usr/local/lib/python3.7/multiprocessing/process.py", line 99, in run
realtimefmri_1_96c86fa3cd6a |     self._target(*self._args, **self._kwargs)
realtimefmri_1_96c86fa3cd6a |   File "/app/realtimefmri/realtimefmri/viewer.py", line 80, in serve
realtimefmri_1_96c86fa3cd6a |     viewer = PyCortexViewer(surface, transform, mask_type, vmin, vmax)
realtimefmri_1_96c86fa3cd6a |   File "/app/realtimefmri/realtimefmri/viewer.py", line 32, in __init__
realtimefmri_1_96c86fa3cd6a |     view = server.get_client()
realtimefmri_1_96c86fa3cd6a |   File "/usr/local/lib/python3.7/site-packages/cortex/webgl/view.py", line 802, in get_client
realtimefmri_1_96c86fa3cd6a |     return JSMixer(self.send, "window.viewer")
realtimefmri_1_96c86fa3cd6a |   File "/usr/local/lib/python3.7/site-packages/cortex/webgl/serve.py", line 318, in __init__
realtimefmri_1_96c86fa3cd6a |     self.attrs = self.send(method='query', params=[self.name])[0]
realtimefmri_1_96c86fa3cd6a |   File "/usr/local/lib/python3.7/site-packages/cortex/webgl/serve.py", line 301, in send
realtimefmri_1_96c86fa3cd6a |     sock.write_message(msg)
realtimefmri_1_96c86fa3cd6a |   File "/usr/local/lib/python3.7/site-packages/tornado/websocket.py", line 342, in write_message
realtimefmri_1_96c86fa3cd6a |     return self.ws_connection.write_message(message, binary=binary)
realtimefmri_1_96c86fa3cd6a |   File "/usr/local/lib/python3.7/site-packages/tornado/websocket.py", line 1098, in write_message
realtimefmri_1_96c86fa3cd6a |     fut = self._write_frame(True, opcode, message, flags=flags)
realtimefmri_1_96c86fa3cd6a |   File "/usr/local/lib/python3.7/site-packages/tornado/websocket.py", line 1075, in _write_frame
realtimefmri_1_96c86fa3cd6a |     return self.stream.write(frame)
realtimefmri_1_96c86fa3cd6a |   File "/usr/local/lib/python3.7/site-packages/tornado/iostream.py", line 555, in write
realtimefmri_1_96c86fa3cd6a |     future = Future()  # type: Future[None]
realtimefmri_1_96c86fa3cd6a |   File "/usr/local/lib/python3.7/asyncio/events.py", line 644, in get_event_loop
realtimefmri_1_96c86fa3cd6a |     % threading.current_thread().name)
realtimefmri_1_96c86fa3cd6a | RuntimeError: There is no current event loop in thread 'Thread-1068'.
@mvdoc mvdoc self-assigned this Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant