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

Daniel Lowe edited comment on SOLR-9168 at 6/16/24 12:28 AM:
-------------------------------------------------------------

[~elyograg] Strictly speaking doesn't SOLR-8803 actually remove the ability to 
specify your own oom handling script? Prior to Solr 9.2 it was possible to 
manually add arbritrary content to `oom_solr.sh` e.g. send an email and/or 
restart Solr

Obviously this isn't wasn'an elegant solution, but if I'm understanding 
correctly is there no longer a way to add a post crash hook?

EDIT: I guess you could still achieve this by adding a call to 
-XX:OnOutOfMemoryError to $SOLR_ADDL_ARGS. I think the script that will be run, 
will run before -XX:+CrashOnOutOfMemoryError kills the JVM though which might 
complicate things 
(https://github.com/openjdk/jdk/blob/8464ce6db5cbd5d50ac2a2bcba905b7255f510f5/src/hotspot/share/utilities/debug.cpp#L267).

(A reason you may want to restart Solr on an OOM error is if you expect the 
errors to typically be caused by inappropriate developer initiated queries e.g. 
facetting on a large full-text field)


was (Author: dan2097):
[~elyograg] Strictly speaking doesn't SOLR-8803 actually remove the ability to 
specify your own oom handling script? Prior to Solr 9.2 it was possible to 
manually add arbritrary content to `oom_solr.sh` e.g. send an email and/or 
restart Solr

Obviously this isn't wasn'an elegant solution, but if I'm understanding 
correctly is there no longer a way to add a post crash hook?

(A reason you may want to restart Solr on an OOM error is if you expect the 
errors to typically be caused by inappropriate developer initiated queries e.g. 
facetting on a large full-text field)

> 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: main (10.0)
>
>         Attachments: 
> 0001-SOLR-9168-Allow-users-to-specify-their-own-OnOutOfMe.patch, 
> SOLR-9168-1.patch, SOLR-9168-2.patch, SOLR-9168-3.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