[
https://issues.apache.org/jira/browse/SOLR-9168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16291693#comment-16291693
]
Tyler Lubeck commented on SOLR-9168:
------------------------------------
Oooh ok I like that a lot. What do you think of something like this:
1. Change the startup command
[here|https://github.com/apache/lucene-solr/blob/7974aa033c7985b4d0dde92776b12ee50aa9ee5c/solr/bin/solr#L2019]
to instead say something like
{{-XX:-XX:OnOutOfMemoryError='USER_SCRIPT=$SOLR_OOM_SCRIPT
$SOLR_TIP/bin/oom_solr.sh'}}
2. Add docs and examples to set {{SOLR_OOM_SCRIPT}} in solr.in.sh
3. Append something like {{[[ -z $USER_SCRIPT]] && exec $USER_SCRIPT}} to the
end of the existing oom_solr.sh script
I'm trying to think of ways to get a custom user variables from solr.in.sh over
to oom_solr.sh. That said, I haven't tested this yet and am totally up for
better suggestions.
Alongside that, are there any values we can provide to a custom OOM script that
might be useful for custom user actions? If so, should we route them as
arguments or on stdin?
> 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
> Labels: oom
> Fix For: 5.5.1
>
> Attachments:
> 0001-SOLR-9168-Allow-users-to-specify-their-own-OnOutOfMe.patch,
> SOLR-9168.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
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]