swagger-api / swagger-ui

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
https://swagger.io
Apache License 2.0
26.35k stars 8.92k forks source link

`Too many files open` error in Windows #2062

Closed Gopikrishna19 closed 8 years ago

Gopikrishna19 commented 8 years ago

I am using swagger(2.1.4) and hapi to serve mock files in developing environment. I abstract parts of response to separate definitions for re-usability. I have this folder structure:

|- index.yaml // $ref to all paths.
|-paths/
| |-eachPath.yaml  // files that start with `get` property, $ref to small definitions
|-defs/
| |-eachDefs.yaml //reusuable piece of api

In windows after a certain amount of definitions and paths, when I try to start the server, not while I ping the api, I hit this error:

EMFILE: Too many files open

at random places. Once I remove certain number of files, this error is suppressed. I get this error even if I don't have hapi handler for that particular path i.e, not actually accessing the path. Just putting the file path in a index.yaml triggers the error. This does not happen in nix systems. I think it has something to do with a limit to number of files open, since windows doesn't have something like a ulimit. I have around 125 definitions (some of them reused) and 40 paths, so it would come around 200 file refs in total.

Any help would be wonderful. Thanks

fehguy commented 8 years ago

This really has nothing to do with swagger UI