File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,13 @@ else
130130 fi
131131fi
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
134141if [ -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
You can’t perform that action at this time.
0 commit comments