question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Robotframework LS keeps a lot of files open when vendored watchdog is used

See original GitHub issue

Describe the bug Robotframework LS seems to be leaking file handles in some situations in macOS. This has happened to me previously, and now it reappeared on a different macOS install. After it starts leaking file handles this problem seems to persist until a restart. This might be a problem with macOS not freeing the old file handles, but I’m unsure of this.

This happens to me running the LS using CoC-nvim as the LSP client. I can also try to reproduce with other editors if that would be useful for debugging.

To Reproduce Open any robot file, try to trigger any LS feature (for example tab completion.

Expected behavior LS works as usual

Screenshots

lsp: 2020-11-13 13:32:33 UTC pid: 49123 - MainThread - EXCEPTION - robocorp_ls_core.basic
Error calling: ['ps', '-p', '49126', '-o', 'stat'].

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/robotframework_ls/vendored/robocorp_ls_core/basic.py", line 128, in is_process_alive
    process = subprocess.Popen(
  File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 825, in __init__
    errread, errwrite) = self._get_handles(stdin, stdout, stderr)
  File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1589, in _get_handles
    c2pread, c2pwrite = os.pipe()
OSError: [Errno 23] Too many open files in system

Versions:

  • OS: macOS catalina 10.15.7 (19H15)
  • Python 3.9
  • Robot Framework Version 3.2.2
  • Robot Framework Language Server Version 0.5.0
  • Client Version :
  • coc.nvim version: 0.0.79-cc975fd0ca
  • node version: v14.15.0
  • vim version: NVIM v0.5.0-nightly-193-g35325ddac

Logs

robotframework_ls.lsp.49123.log

Sometimes when I reproduce this problem, some log files don’t get correctly written (probably related to the file handle problem). I’ll try to get the other log files but it might be a bit difficult.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
fabiozcommented, Mar 18, 2021

Another option would be using polling instead of native file-watching.

i.e.: https://github.com/robocorp/robotframework-lsp/issues/238#issuecomment-789867965

By default the language server will still use watchdog, but now it's also possible to set an environment variable:

ROBOTFRAMEWORK_LS_WATCH_IMPL=fsnotify

to force the usage of polling.
1reaction
fabiozcommented, Dec 7, 2020

It seems that the previous version of watchdog (0.10.3) works properly, so, I’m distributing that version with the binary dependencies now to fix this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PyCharm with LSP - Robot Framework
Worth mentioning is that if you are trying to run lsp on Mac, lsp might be failing because it tries to open a...
Read more >
Package List — Spack 0.20.0.dev0 documentation
The Advanced Multi-Physics (AMP) package is an open source parallel object-oriented computational framework that is designed with single and multi-domain ...
Read more >
Current problem reports - FreeBSD Mailing lists
... port: security/p5-Unix-Passwd-File Use (or manipul o ports/182322 ... python [Maintainer Update] devel/py-robotframework-ride versi o ...
Read more >
Telecom Info
SIP is a protocol that is commonly used in VoIP (Voice over Internet Protocol) systems to set up, modify, and terminate sessions that...
Read more >
service-names-port-numbers.txt
Service names and port numbers are used to distinguish between different services that run over transport protocols such as TCP, UDP, DCCP, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found