D1457: workers: create backgroundcloser per thread
indygreg (Gregory Szorc)
phabricator at mercurial-scm.org
Mon Nov 20 22:55:05 EST 2017
indygreg requested changes to this revision.
indygreg added a comment.
This revision now requires changes to proceed.
The main reason we have this restriction is because there is an upper limit to the number of open file descriptors a process can have. So if we have multiple instances and each is managing file closes for thousands of files, we could easily exhaust all available file descriptors. This would lead to random I/O failures (likely when trying to open a file), which would likely raise an uncaught exception and lead to an abort.
So if we want to use multiple threads for workers on Windows, I think a better course of action is to reuse the singleton background file closer from all threads or not use a background file closer at all.
To: wlis, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel
More information about the Mercurial-devel