-
Notifications
You must be signed in to change notification settings - Fork 32
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
Broken with neovim python-client 0.3.0: request from non-main thread #25
Comments
Thanks for reporting! It seems with 0.3.0, Neovim is now raising an error when attempting to perform an API request from a different thread. (Although, technically it works.) Since I'm currently traveling, I'll need some time to look into this and properly fix it. However, I'll try to come up with a quickfix that bypasses the error message until then. Sorry for the trouble. (If someone feels like supplying a patch, please go ahead. I'm happy for a PR.) |
Thanks for your response! For other's reference, this is the commit that started to prevent requests from a different thread: neovim/pynvim#255 I will also look into this after I get into a free cycle. |
Calls from other threads must use It might have been working by accident for some use patterns, but is inherently racy and could trigger issues on any code or environmental change. An API should only be considered thread-safe it it explicitly claims to be. Changing unpredictable behavior to a consistent error message is not a breaking change, it only makes already present issues to be discovered faster. |
@bfredl Thanks for clarifying! Not sure how I missed that. This will probably resolve other bugs here too. Mentioning in the error message or the source that |
Due to a change from neovim python-client 0.3.0, it is now required that nvim API calls from other threads must use nvim.async_call(). This commit wraps all such API calls from the background thread (via self._wrap_async) to make use of nvim.async_call(). See #25 for details.
Due to a change from neovim python-client 0.3.0, it is now required that nvim API calls from other threads must use nvim.async_call(). This commit wraps all such API calls from the background thread (via self._wrap_async) to make use of nvim.async_call(). See #25 for details.
@numirias Indeed, I will improve the message to next version. |
On startupAfter opening a python file, the following error occurs. Both on neovim 0.2.1 and 0.3.1.Installing neovim==0.2.6 is a workaround until it is fixed.
neovim API has breaking changes...See #25 (comment)The text was updated successfully, but these errors were encountered: