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

Thread error #34

Closed
davidbrochart opened this issue Apr 19, 2022 · 5 comments
Closed

Thread error #34

davidbrochart opened this issue Apr 19, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@davidbrochart
Copy link
Collaborator

davidbrochart commented Apr 19, 2022

I've noticed that since I've been using y-py in the back-end in Jupyter, I have threading issues while exiting with Ctrl-C:

Exception ignored in: <module 'threading' from '/home/david/mambaforge/envs/jupyterlab-dev/lib/python3.10/threading.py'>
Traceback (most recent call last):
  File "/home/david/mambaforge/envs/jupyterlab-dev/lib/python3.10/threading.py", line 1560, in _shutdown
    lock.acquire()
KeyboardInterrupt: 
FATAL: exception not rethrown
Aborted (core dumped)

I know that Yrs uses threads, so it might be related.

@Waidhoferj
Copy link
Collaborator

Ypy isn't thread safe, at least for passing objects between threads. I'm guessing that is causing the issue. Yrs has moved over to using atomics in some areas of the code, so it might be possible to improve Ypy for use in multithreaded applications. Do you have any example code for where the error occurred?

@Waidhoferj Waidhoferj added the bug Something isn't working label Apr 20, 2022
@davidbrochart
Copy link
Collaborator Author

The issue doesn't happen when passing ypy objects between threads, but when exiting JupyterLab with Ctrl-C. You can reproduce it with this branch. But as this operation uses a thread, maybe it doesn't play well with ypy. All I can say is that it didn't happen before using ypy.

@Waidhoferj
Copy link
Collaborator

Could possibly be a PyO3 issue.

@Waidhoferj
Copy link
Collaborator

@davidbrochart was this fixed by the time the branch was merged?

@davidbrochart
Copy link
Collaborator Author

Yes, I think this issue disappeared. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants