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 @@ -121,6 +121,13 @@ else
121121 fi
122122fi
123123
124+ # This is a band-aid fix to avoid the failure of Maven nightly snapshot in some Jenkins
125+ # machines by explicitly calling /usr/sbin/lsof. Please see SPARK-22377 and the discussion
126+ # in its pull request.
127+ LSOF=lsof
128+ if ! hash $LSOF 2> /dev/null; then
129+ LSOF=/usr/sbin/lsof
130+ fi
124131
125132if [ -z " $SPARK_PACKAGE_VERSION " ]; then
126133 SPARK_PACKAGE_VERSION=" ${SPARK_VERSION} -$( date +%Y_%m_%d_%H_%M) -${git_hash} "
@@ -337,7 +344,7 @@ if [[ "$1" == "publish-snapshot" ]]; then
337344 -DskipTests $PUBLISH_PROFILES clean deploy
338345
339346 # Clean-up Zinc nailgun process
340- lsof -P | grep $ZINC_PORT | grep LISTEN | awk ' { print $2; }' | xargs kill
347+ $LSOF -P | grep $ZINC_PORT | grep LISTEN | awk ' { print $2; }' | xargs kill
341348
342349 rm $tmp_settings
343350 cd ..
@@ -375,7 +382,7 @@ if [[ "$1" == "publish-release" ]]; then
375382 -DskipTests $PUBLISH_PROFILES clean install
376383
377384 # Clean-up Zinc nailgun process
378- lsof -P | grep $ZINC_PORT | grep LISTEN | awk ' { print $2; }' | xargs kill
385+ $LSOF -P | grep $ZINC_PORT | grep LISTEN | awk ' { print $2; }' | xargs kill
379386
380387 ./dev/change-version-to-2.10.sh
381388
You can’t perform that action at this time.
0 commit comments