joefitzgerald/go-plus

socket: too many open files

aaronn opened this issue · 4 comments

socket: too many open files

Prerequisites

  • Have you tried launching atom . from the terminal in your project's directory?
  • Have you verified the output from go env is correct? If it is, please include the output in this issue.
  • Have you updated Atom to the latest version?
  • Have you tried using Atom Beta, which can be run side-by-side with Atom Stable? Is the behavior the same, or different?
  • Have you updated your Atom packages to the latest versions?
  • Have you read the FAQ?
  • Have you searched the issues to see if others are experiencing the same issue?

Description

I'm getting this error when I save and run my tests through go-plus.

panic: socket: too many open files

I've set the ulimit for openfiles to the hard maximum, and tests run file in my normal terminal, just not in the atom output in go-plus

Output from atom -v && apm -v

Atom    : 1.33.0
Electron: 2.0.11
Chrome  : 61.0.3163.100
Node    : 8.9.3
apm  2.1.2
npm  6.2.0
node 8.9.3 x64
atom 1.33.0
python 2.7.15
git 2.17.2

Output From go env

panic: socket: too many open files

Steps to Reproduce

  1. Dial greater than the macOS limit (256) in tcp connections. Someone has an example here:
    https://stackoverflow.com/questions/32325343/go-tcp-too-many-open-files-debug

Expected Behavior

Tests should run respecting the system-wide ulimit I've set. They run successfully in terminal, just not in the go-plus output.

Actual Behavior

I get a panic when the number of openfiles is greater than the default macOS system limit, not the newly set one.

zmb3 commented

Going to need some help to figure this one out.

Does this reproduce every time you run tests? If you reboot your computer does it take longer for the issue to occur?

@zmb3 This indeed happens every time I run tests. I have integration tests for a rudimentary distributed system and simulating a couple hundred servers, so it very quickly reaches the limit. Rebooting does nothing.

However, as I mentioned changing the ulimit makes it magically 'just work' in Terminal. It always works in terminal, it just doesn't work in go-plus.

zmb3 commented

If it always happens immediately then its less likely that we're leaking file descriptors.

Does it work in the terminal even when Atom is open? I'm wondering if its just a side effect of Atom holding many files open.

@zmb3 It works in Terminal.app even when Atom is open, yeah.