-
Notifications
You must be signed in to change notification settings - Fork 148
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 pipe error and test drive report #274
Comments
Thanks for the thorough and well-documented look-through!
Many of these seem like insidious pyls errors, it'll take more time and
pixels on the pip freeze to see if something jumps out. They
syntax-error-hides-everything, for example, is known, and we can't do squat
about it. Doing a "pip check" might reveal yet more things. Why pip doesn't
always install an internally-consistent set of packages I still don't
know...
I like the theory of a pluggable python language server, written in python,
but maybe I have to dust off my non-existent mono skills and package up the
Microsoft one, as the poor end user experience with this language server is
tough to work around. But that seems even less likely to be pip installable.
Yes, we are presently doing custom websockets... There's an open issue for
potentially refactoring to having a single "language server kernel" such
that we could defer more complexity to existing machinery... Even still, a
number of the UI hooks in lab expect there to be exactly one source of
information (usually kernel message futures) while we're having to
multiplex kernel/lsp responses.
…On Wed, May 27, 2020, 16:54 Paul Ivanov ***@***.***> wrote:
Hi there,
I tried out JupyterLab-LSP and wanted to share my experience. You can find
it here:
https://github.com/ivanov/jlsp-test-drive/blob/master/README.md
The short version is many things did not work for me, and most of them
resulted in a notebook server console log error message that looked
something like this:
Bad message (TypeError('not all arguments converted during string formatting')): {'name': 'LabApp', 'msg': "s couldn't write message: %s", 'args': (<LspStdIoWriter(parent=<LanguageServerSession(language_server=pyls, argv=['/home/pi/.virtualenvs/jlsp/bin/pyls'])>)>, 'Content-Length: 218\r\n\r\n{"jsonrpc":"2.0","id":276,"method":"textDocument/references","params":{"context":{"includeDeclaration":true},"textDocument":{"uri":"file:///home/pi/code/pid/wpid/lsp/highlight.py"},"position":{"line":1,"character":2}}}'), 'levelname': 'ERROR', 'levelno': 40, 'pathname': '/home/pi/.virtualenvs/jlsp/lib/python3.8/site-packages/jupyter_lsp/stdio.py', 'filename': 'stdio.py', 'module': 'stdio', 'exc_info': (<class 'BrokenPipeError'>, BrokenPipeError(32, 'Broken pipe'), <traceback object at 0x7f3658674240>), 'exc_text': None, 'stack_info': None, 'lineno': 163, 'funcName': 'write', 'created': 1590606815.4147756, 'msecs': 414.7756099700928, 'relativeCreated': 1358175.628900528, 'thread': 139871523256128, 'threadName': 'MainThread', 'processName': 'MainProcess', 'process': 84827}
Traceback (most recent call last):
File "/home/pi/.virtualenvs/jlsp/lib/python3.8/site-packages/jupyter_lsp/stdio.py", line 161, in write
await convert_yielded(self._write_one(response.encode("utf-8")))
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/pi/.virtualenvs/jlsp/lib/python3.8/site-packages/jupyter_lsp/stdio.py", line 169, in _write_one
self.stream.write(message)
BrokenPipeError: [Errno 32] Broken pipe
I used Python 3.8.3 on Debian unstable with
jupyter-lsp==0.8.0
jupyterlab==2.0.2
jupyterlab-server==1.0.7
python-language-server==0.31.10
The output of jupyter labextension list
JupyterLab v2.0.2
Known labextensions:
app dir: /home/pi/.virtualenvs/jlsp/share/jupyter/lab
@krassowski/jupyterlab-lsp v1.0.0 enabled OK
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://github.com/krassowski/jupyterlab-lsp/issues/274>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAALCRHJJSR32VI64LVZZ6DRTV4WZANCNFSM4NMPW4ZQ>
.
|
Thanks, @bollwyvl
Am I the only one that's ever hit the |
Yeah, that error (aside from the bad error formatting, which has been
fixed, but not released) seems to happen when a language server process is
still running, but its stdin dies. It was tricky to get it working at all,
especially on windows, nonblocking, but bad days are bad. So it's probably
a combination of errors in how our stdio proxy handles errors, and how the
upstream (in this case pyls) handles errors, and then actually some error.
And, given the whole ProactorLoop issue we fought through, that error may
well be in python.
In this repo we could:
- retry, with back-off... maybe just stuff it back onto the queue and sleep
a while
- at least handle more gracefully
One of the advantages of moving it to the kernel bus is it might be
possible to surface these kinds of messages more easily into the web ui
itself, rather than having them buried in the terminal log... but then,
sometimes kernel stuff ends up there, too!
So anyhow: i guess we leave this open until somebody has a chance to think
about it more, and is working on the backend. I do intend to spend some
more effort on it at some point, but don't have a timeline for
availability... PRs welcome!
|
thanks for writing that up, Nick, I appreciate it. |
183 class LspStdIoWriter(LspStdIoBase):
184 """Language Server stdio Writer"""
185
186 async def write(self) -> None:
187 """Write to a Language Server until it closes"""
188 while not self.stream.closed:
189 message = await self.queue.get()
190 try:
191 body = message.encode("utf-8")
192 response = "Content-Length: {}\r\n\r\n{}".format(len(body), message)
193 await convert_yielded(self._write_one(response.encode("utf-8")))
194 except BrokenPipeError:
195 # self.queue.task_done()
196 # propagate broken pipe errors
197 raise
198 except Exception: # pragma: no cover
199 # catch other (hopefully mild) exceptions
200 self.log.exception("%s couldn't write message: %s", self, response)
201 finally:
202 self.queue.task_done()
203
204 @run_on_executor
205 def _write_one(self, message) -> None:
206 self.stream.write(message)
207 self.stream.flush() Hi
Here's the wheel file |
There's another question |
Hi there,
I tried out JupyterLab-LSP and wanted to share my experience. You can find it here:
https://github.com/ivanov/jlsp-test-drive/blob/master/README.md
The short version is many things did not work for me, and most of them resulted in a notebook server console log error message that looked something like this:
I used Python 3.8.3 on Debian unstable with
The output of
jupyter labextension list
The text was updated successfully, but these errors were encountered: