Closed StevenLevine closed 7 years ago
@StevenLevine thanks for creating a ticket for that! Can you please remind me which use case exactly brought this problem for you? So that I could test it locally. I remember you told me once but I can't find it in logs.
Any large repo with sufficient update activity should be a good testcase
Try: git://github.com/php/php-src.git
I tend to use git:// rather than https:// because git:// seems to be faster.
The error you should see is fatal: mmap failed: Too many open files
The initial git clone should have no issues. However a git pull or git fsck will eventually report out of handles errors in mmap.
Right. I recalled it now, thanks. BTW, as this shows up under heavy load, it has some similarities with #30 in this regard. JFYI.
Unfortunately, I cannot reproduce the problem myself but I implemented the suggested fix (mmap file handles are never passed to LIBC so it should be safe). Please check in your environment.
Currently mmap.c:484 arc = DosDupHandle(fildes, &fh->fd);
will fail if DosDupHandle fails with ERROR_TOO_MANY_OPEN_FILES. This can be avoided by invoking DosSetRelMaxFH to increase the number of available handles and retrying the request.
FWIW, there is a potential conflict with kLIBC. It is possible that the duplicated handles will conflict with one of kLIBC's faked socket handles. This will not be an issue as long as the handle created by mmap() is never passed to kLIBC.