[ 
https://issues.apache.org/jira/browse/SOLR-9168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17614549#comment-17614549
 ] 

Shawn Heisey commented on SOLR-9168:
------------------------------------

Before tackling using a user-supplied script, I would like to get Solr using 
-XX:+CrashOnOutOfMemoryError so there is more feature parity between the shell 
script and the Windows cmd script.  When Solr was requiring Java 8, we couldn't 
really do this because we couldn't be sure the user would have a Java version 
new enough.  Now that we require Java 11, we can be sure it's supported.

This change gets us two things:
 * Solr will not continue running after OOME, not even for whatever subsecond 
time it takes to run the OOM script and kill Solr.  Java will crash instead.  
Lucene will hopefully be resilient against index corruption.  I know a lot of 
work has been done in that regard.  There is probably MORE danger of index 
corruption with the current OOME handling, because SOlr keeps running for a 
short time after OOME until the OOM script gets around to killing it.
 * On OOME, a crash file will always be written to the temp directory that will 
preserve the first part of the OOME exception that describes what resource was 
depleted.  Frequently when Solr throws OOME it happens in a section of code 
that doesn't do any logging, so the exception is never logged.  That makes it 
difficult to troubleshoot the OOME, and this change would eliminate that 
problem.

 

> Add availability to specify own oom handing script
> --------------------------------------------------
>
>                 Key: SOLR-9168
>                 URL: https://issues.apache.org/jira/browse/SOLR-9168
>             Project: Solr
>          Issue Type: Improvement
>          Components: scripts and tools
>    Affects Versions: 5.5.1
>            Reporter: AngryDeveloper
>            Priority: Major
>              Labels: oom
>             Fix For: 9.1, main (10.0)
>
>         Attachments: 
> 0001-SOLR-9168-Allow-users-to-specify-their-own-OnOutOfMe.patch, 
> SOLR-9168-userdefined.patch, SOLR-9168.patch, solr-crash-oom.patch
>
>
> Right now the start script always uses $SOLR_TIP/bin/oom_solr.sh  to handle 
> OutOfMemoryException. This script only kills instance of solr.
> We need to do some additional things (e.g sent mail about this exception)
> What do you think about adding possibility to set up own script?
> Proposition:
> {code}
> if [ -z "$SOLR_OOM_SCRIPT" ]; then
>   SOLR_OOM_SCRIPT=$SOLR_TIP/bin/oom_solr.sh 
> fi
> [...]
> nohup "$JAVA" "${SOLR_START_OPTS[@]}" $SOLR_ADDL_ARGS \
>       "-XX:OnOutOfMemoryError=$SOLR_OOM_SCRIPT $SOLR_PORT $SOLR_LOGS_DIR" \
>         -jar start.jar "${SOLR_JETTY_CONFIG[@]}" \
>       1>"$SOLR_LOGS_DIR/solr-$SOLR_PORT-console.log" 2>&1 & echo $! > 
> "$SOLR_PID_DIR/solr-$SOLR_PORT.pid"
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to