[ 
https://issues.apache.org/jira/browse/SOLR-16191?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Gibney updated SOLR-16191:
----------------------------------
    Description: 
SOLR-15558 made more apparent some assumptions/implicit dependencies on the 
Linux {{ps}} command in the {{solr/bin/solr}} script. The script already 
[disables running in 
cygwin|https://github.com/apache/solr/blob/f5e927ed1ed9cb43ac843cac4e12b6edc1b8a904/solr/bin/solr#L58-L63]
 because of utility version incompatibility, but perhaps we could also/instead 
add "walks like a duck" sanity-check, e.g.:

{code:sh}
if [ "$$" != "`ps -o pid='' $$`" ]; then
  exit 1
fi
{code}

The issue arose while running {{gradlew :solr:packaging:integrationTests}} for 
Alpine Linux with BusyBox {{ps}} installed, for which {{ps -o pid='' 
$WHATEVER}} dumps all running pids, regardless of the value of {{$WHATEVER}}. 
The behavior observed appeared mainly to affect {{solr stop}}, where the 
command watches for the PID to exit, but the pid is never detected as having 
exited. I'm not sure, it's possible that jstack/kill was being run against 
random PIDs!

  was:
SOLR-15558 made more apparent some assumptions/implicit dependencies on the 
Linux {{ps}} command in the {{solr/bin/solr}} script. The script already 
[disables running in 
cygwin|https://github.com/apache/solr/blob/f5e927ed1ed9cb43ac843cac4e12b6edc1b8a904/solr/bin/solr#L58-L63]
 because of utility version incompatibility, but perhaps we could also/instead 
add "walks like a duck" sanity-check, e.g.:

{code:sh}
if [ "$$" != "ps -o pid='' $$" ]; then
  exit 1
fi
{code}

The issue arose while running {{gradlew :solr:packaging:integrationTests}} for 
Alpine Linux with BusyBox {{ps}} installed, for which {{ps -o pid='' 
$WHATEVER}} dumps all running pids, regardless of the value of {{$WHATEVER}}. 
The behavior observed appeared mainly to affect {{solr stop}}, where the 
command watches for the PID to exit, but the pid is never detected as having 
exited. I'm not sure, it's possible that jstack/kill was being run against 
random PIDs!


> Sanity-check assumptions about Linux `ps` command in `solr/bin/solr` script
> ---------------------------------------------------------------------------
>
>                 Key: SOLR-16191
>                 URL: https://issues.apache.org/jira/browse/SOLR-16191
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: scripts and tools
>    Affects Versions: 9.0, 8.11.2, main (10.0)
>            Reporter: Michael Gibney
>            Priority: Minor
>
> SOLR-15558 made more apparent some assumptions/implicit dependencies on the 
> Linux {{ps}} command in the {{solr/bin/solr}} script. The script already 
> [disables running in 
> cygwin|https://github.com/apache/solr/blob/f5e927ed1ed9cb43ac843cac4e12b6edc1b8a904/solr/bin/solr#L58-L63]
>  because of utility version incompatibility, but perhaps we could 
> also/instead add "walks like a duck" sanity-check, e.g.:
> {code:sh}
> if [ "$$" != "`ps -o pid='' $$`" ]; then
>   exit 1
> fi
> {code}
> The issue arose while running {{gradlew :solr:packaging:integrationTests}} 
> for Alpine Linux with BusyBox {{ps}} installed, for which {{ps -o pid='' 
> $WHATEVER}} dumps all running pids, regardless of the value of {{$WHATEVER}}. 
> The behavior observed appeared mainly to affect {{solr stop}}, where the 
> command watches for the PID to exit, but the pid is never detected as having 
> exited. I'm not sure, it's possible that jstack/kill was being run against 
> random PIDs!



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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

Reply via email to