On 8/16/2024 15:05, mtn search wrote:
oom_solr.sh is provided by Solr to kill the solr process on OOM and log this event. Is it a common practice to then also create supporting functionality to automatically restart solr after the kill?
IMHO, in general, it is a bad idea to automatically restart Solr on OOME crash. The reason is that whatever caused the OOME is likely to simply occur again, causing another crash. When OOME occurs, it is usually an indication that there is a serious resource availability issue that will require admin intervention to fix.
In Solr 9.2, this feature was replaced with Java's built-in ability to crash the process on OOME instead of running a script. This also made the feature work on Windows. I did this work. Before, the cause of the OOME was very often lost because it would only get logged if the section of code where the OOME occured had exception logging. Solr has a lot of code without any logging. Now, the cause of the OOME is always logged in Java's error file.
That said, you are free to implement your own auto-restart mechanism. Thanks, Shawn