Continue to check if a chia pid has disappeared if the log file is not available#263
Continue to check if a chia pid has disappeared if the log file is not available#263programmatix wants to merge 1 commit intoswar:mainfrom
Conversation
…t available Full context is on swar#246 Due to another bug, the manager has found Chia processes but has not been able to find an associated log file for that. The code will currently skip over a pid in this scenario. This leads to a situation where Chia processes are finished normally but the manager is not aware. This patch does the pid_exists check, even if the logfile is not available.
|
This is really good research that you've done @programmatix because this issue has occurred for some people. I took a look through everything you said in #246 and the PR that you made and although this will fix that log file not being found issue. It will break for Linux users where their PID continues to exist even after the plot is finished. I don't know the best solution to this unfortunately. |
|
Hey @swar Sorry I'm not sure I'm following - you're saying that on Linux, the PID continues to exist even once the chia process has exitted, post-plot? I think the truly best solution to this is to figure out what's causing the SystemExtendedHandleInformation error. Because my workaround (in the PR) only partially solves things - it does keep things running (and it's running fine after a week of testing), but because the log files weren't opened I don't get any progress info. E.g. all the plots claim to be in phase 1 with 0 progress. But I'm not sure what's going on with the SystemExtendedHandleInformation error... As mentioned, after doing some quick research on NtQuerySystemInformation, SystemExtendedHandleInformation, and STATUS_INFO_LENGTH_MISMATCH, I can't see anything obviously wrong with the psutils code looks ok to me. So, I'm not sure where to take this either. I thought, instead of using this psutils interface to find what logfiles a chia process has open, maybe instead only look in the log directory (maybe only on Windows) - but then that won't work I think, as I don't see any PID in the logfiles. |
|
Yes there are no PIDs in the log files and you don't even know what plot id is assigned to a running process either. That's why the current implementation exists. There's no easy cross platform solution other than finding a better way to identify log files. Which can potentially be done but will take some time to implement. |
Full context is on #246
Due to another issue (possibly in psutils), the manager has found Chia processes but has not been able to find an associated log file for them.
The code will currently skip over a pid in this scenario, while trying to get its status. This leads to a situation where Chia processes are finished normally but the manager is not aware.
This patch does a pid_exists check, even if the logfile is not available.