Skip to content
This repository has been archived by the owner on Aug 21, 2022. It is now read-only.

Language server error with "open /dev/null: too many open files *os.PathError" #67

Closed
GimmyHchs opened this issue Jan 20, 2019 · 14 comments · Fixed by #82
Closed

Language server error with "open /dev/null: too many open files *os.PathError" #67

GimmyHchs opened this issue Jan 20, 2019 · 14 comments · Fixed by #82
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@GimmyHchs
Copy link

GimmyHchs commented Jan 20, 2019

I'm using bingo as LSP server in emacs and everything works well.

LSP was broken after I update the source code and rebuild it.

the error appears after commit 95ba275

reproduce steps:

rm $GOPATH/bin/bingo  // remove old version bingo
git checkout 95ba27549b1fe1b38eea0d6b09078fa74823f616
GO111MODULE=on go install

then open emacs.
see errors:

load /path/to/project/root/ successfully! elapsed time: 5 seconds
notify: open  /path/to/project/submodule1/: too many open files
notify: open  /path/to/project/submodule2/: too many open files
....
Error from the Language Server: couldn’t exec ’go [list -f {{context.GOARCH}} {{context.Compiler}} -- unsafe]’: open /dev/null: too many open files *os.PathError (Unknown error)

if I checkout to 5963059
and rebuild again. Everything works well.

@saibing
Copy link
Owner

saibing commented Jan 20, 2019

@GimmyHchs

please update bingo to latest commit, and tell me the watch dir number as follow:

image

@saibing saibing self-assigned this Jan 20, 2019
@GimmyHchs
Copy link
Author

load /path/to/project/root/ successfully! elapsed time: 6 seconds, watch dir number: 52, cached: true

@saibing
Copy link
Owner

saibing commented Jan 20, 2019

@GimmyHchs

Is the error still there?

@GimmyHchs
Copy link
Author

YES

@GimmyHchs
Copy link
Author

GimmyHchs commented Jan 20, 2019

I noticed that the errors only appear when the go-project has many submodules & files

@saibing
Copy link
Owner

saibing commented Jan 20, 2019

@GimmyHchs

How to reproduce this problem? I can not reproduce it.

@GimmyHchs
Copy link
Author

@saibing
I could only reproduce this problem some of my projects.

close this issue until I found the pattern to reproduce.

thx!

@GimmyHchs
Copy link
Author

GimmyHchs commented Jan 20, 2019

@saibing
I'm using macOS Mojave.

checking the number of opened files by:

$ lsof -n|awk '{print $2}'|sort|uniq -c|sort -nr|more

bingo-67-1

  • projectA -> error
  • projectB -> error
  • project go-langserver -> normal

reproduce steps:

  1. Add a lot of files as Fake-Submodule into project go-langserver
  2. Restart bingo-lsp server.

bingo-67-2

  • project go-langserver -> error

========================================
I think the bug appears because opening too many files for cache-features 95ba275#diff-16cb8f09bce858d105c4086d6b676375R239.
and the number of opened files is too large so that exceed the range of my system.

@GimmyHchs GimmyHchs reopened this Jan 20, 2019
@s-kostyaev
Copy link

s-kostyaev commented Jan 21, 2019

Also have this issue on latest commit (Also macOS Mojave). I think the root of problem is fsnotify/fsnotify#11

@s-kostyaev
Copy link

Possible solution is another fs notify implementation based on https://github.com/fsnotify/fsevents with darwin build tag. I can try to implement it at the weekend.

@saibing saibing added the enhancement New feature or request label Jan 28, 2019
@saibing
Copy link
Owner

saibing commented Jan 28, 2019

@s-kostyaev

I feel very happy, if you can solve this problem.

I don't have a Mac to test this problem.

@saibing saibing added the help wanted Extra attention is needed label Jan 28, 2019
@s-kostyaev
Copy link

Ok, I'll try.

@saibing saibing added bug Something isn't working enhancement New feature or request and removed enhancement New feature or request bug Something isn't working labels Jan 30, 2019
@jguenther
Copy link

jguenther commented Feb 1, 2019

I also am intermittently getting this error in projects with lots of non-go files.

The one I was having trouble with the other day had a python virtualenv in it with a bunch of .py files, and from lsof output for the bingo process it had filehandles open for all of them

(on macos)

@mbana
Copy link
Contributor

mbana commented Feb 4, 2019

[Info  - 10:35:39 AM] notify: open /Users/mbana/work/openbankinguk/bitbucket/conformance-suite/web/node_modules/yorkie: too many open files
...
[Info  - 10:35:39 AM] fsnotify watch dir number: 1135
...

Confirming same issue on Mac.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants