mkottman / lua-git

An attempt to implement the basics of Git in pure Lua
40 stars 10 forks source link

Cannot install batteries under Windows: too many open files #8

Closed mnicky closed 11 years ago

mnicky commented 11 years ago

When trying to install batteries with luadist-git under Windows, I'm getting an error about too many open files from git-lua:

C:\luadist\_install\_test\_new>bin\luadist.exe _source install batteries
Finding out available versions of batteries...
Getting batteries-0.9.7 (source)...
Finding out available versions of lua...
Getting lua-5.1.5 (binary)...
Finding out available versions of luadist-git...
Getting luadist-git-0.2.1 (binary)...
Finding out available versions of luafilesystem...
Getting luafilesystem-1.6.2 (binary)...
Finding out available versions of srlua...
(...)
Finding out available versions of unzip...
Getting unzip-6.0 (binary)...
Finding out available versions of zip...
Getting zip-3.0 (binary)...
Finding out available versions of iup...
Getting iup-3.6 (binary)...
Getting batteries-0.9.6 (source)...
Cannot install package 'batteries': Error when retrieving the info about 'batteries': Error fetching package batteries-0.9.6' from 'git://github.com/LuaDist/batteries.git' to 'C:\luadist\_install\_test\_new\_source\tmp': ...dist\_install\_test\_new\bin\..\lib\lua\git\repo.lua:186: C:\luadist\_install\_test\_new\_source\tmp\batteries-0.9.6\.git/HEAD: Too many open files

When downloading the package (in package.fetch_pkg()), luadist-git itself doesn't open any files, so I think that the bug will be probably in lua-git.


I found a few file handles in lua-git source, that don't seem to be explicitly closed. As I don't know the internals of lua-git very well, I don't know which ones could be closed and which not. So I'm providing just their list, which might be at least of a little help:

file handles returned from io.open():

file handles returned from io.tmpfile():

file handles returned from other functions:

mkottman commented 11 years ago

Yes there are a lot of unclosed files. I will try to close as many as possible, and document where the closing is left for the user.