Closed AlexHls closed 1 year ago
Thanks for the investigation.
What version of httpstan are you using? This should have been fixed in https://github.com/stan-dev/httpstan/pull/614
Apparently my httpstan version did not update when updating pystan. Updating manually to the newest version of httpstan seems to fix the issue. Thanks for the hint.
Describe the bug
Sampling a model leaks file descriptors, which becomes a problem when running many fits in sequence using the same process (e.g. during bootstrap resampling). Increasing the number of possible open files is a possible temporary fix, but does not work for huge number of resampling sequences. In my case, I need to run ~510^6 fits, which inevitably leads to and OSError [Errno 24]. It seems to originate from some bad file descriptors left behind by the `/tmp/httpstan_.sock
files and some sockets (i.e. when trying to manually close the file descriptors,
os.fstat` returns a BadFileDescriptor error). I've attached a MWE illustarting the increase in the number of used file descriptors. This might be an upstream problem, but I could not verify this.Describe your system
Output (without stanc messages):