Skip to content

Commit 5a513ac

Browse files
committed
Use /usr/sbin/lsof if lsof does not exists in release-build.sh
1 parent 21a7bfd commit 5a513ac

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

dev/create-release/release-build.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ else
130130
fi
131131
fi
132132

133+
# This is a band-aid fix to avoid the failure of Maven nightly snapshot in some Jenkins
134+
# machines by explicitly calling /usr/sbin/lsof. Please see SPARK-22377 and the discussion
135+
# in its pull request.
136+
LSOF=lsof
137+
if ! hash $LSOF 2>/dev/null; then
138+
LSOF=/usr/sbin/lsof
139+
fi
133140

134141
if [ -z "$SPARK_PACKAGE_VERSION" ]; then
135142
SPARK_PACKAGE_VERSION="${SPARK_VERSION}-$(date +%Y_%m_%d_%H_%M)-${git_hash}"
@@ -345,7 +352,7 @@ if [[ "$1" == "publish-snapshot" ]]; then
345352
# -DskipTests $SCALA_2_12_PROFILES $PUBLISH_PROFILES clean deploy
346353

347354
# Clean-up Zinc nailgun process
348-
lsof -P |grep $ZINC_PORT | grep LISTEN | awk '{ print $2; }' | xargs kill
355+
$LSOF -P |grep $ZINC_PORT | grep LISTEN | awk '{ print $2; }' | xargs kill
349356

350357
rm $tmp_settings
351358
cd ..
@@ -382,7 +389,7 @@ if [[ "$1" == "publish-release" ]]; then
382389
# -DskipTests $SCALA_2_12_PROFILES §$PUBLISH_PROFILES clean install
383390

384391
# Clean-up Zinc nailgun process
385-
lsof -P |grep $ZINC_PORT | grep LISTEN | awk '{ print $2; }' | xargs kill
392+
$LSOF -P |grep $ZINC_PORT | grep LISTEN | awk '{ print $2; }' | xargs kill
386393

387394
#./dev/change-scala-version.sh 2.11
388395

0 commit comments

Comments
 (0)