Skip to content

Conversation

@shaneknapp
Copy link
Contributor

What changes were proposed in this pull request?

the final line in the mvn helper script in build/ attempts to shut down the zinc server. due to the zinc server being set up w/a 30min timeout, by the time the mvn test instantiation finishes, the server times out.

this means that when the mvn script tries to shut down zinc, it returns w/an exit code of 1. this will then automatically fail the entire build (even if the build passes).

How was this patch tested?

i set up a test build:
https://amplab.cs.berkeley.edu/jenkins/job/sknapp-testing-spark-branch-2.4-test-maven-hadoop-2.7/

build/mvn Outdated
if [ $ZINC_STATUS -eq 0 ]; then
# zinc is still running!
"${ZINC_BIN}" -shutdown -port ${ZINC_PORT}
exit 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose you just want to exit 0 outside the if-else, for clarity, but whatever. This is all fine and can be back-ported back to 2.2

Copy link
Contributor Author

@shaneknapp shaneknapp Oct 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i put the else in there for clarity, and in case we want to ever do something (like report that zinc timed out etc) if the exit code on the status is 1.

¯\(ツ)

i'm also not a fan of putting exit 0 at the end of any bash script, anywhere, ever.

@SparkQA
Copy link

SparkQA commented Oct 26, 2018

Test build #98094 has started for PR 22854 at commit 2f0a91b.

build/mvn Outdated
"${ZINC_BIN}" -status -port ${ZINC_PORT} &> /dev/null
ZINC_STATUS=$?

# Try to shut down zinc explicitly if the server is still running
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's very unlikely, but there is a chance that the zinc is timed out between we check its status and shut it down. Since zinc will be timed out eventually, we don't care too much about if we can shut it down successfully here.

So how about "${ZINC_BIN}" -shutdown -port ${ZINC_PORT} || true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now that i'm a couple cups of coffee in to my morning, i'm actually back to thinking that this might be the most elegant way of dealing w/this.

i'll update the PR to do just this, and include a comment describing why we're doing it.

@shaneknapp
Copy link
Contributor Author

test this please

@SparkQA
Copy link

SparkQA commented Oct 26, 2018

Test build #98099 has started for PR 22854 at commit 627e7d8.

@shaneknapp
Copy link
Contributor Author

here's the test build run that's actually testing the changes to mvn:
https://amplab.cs.berkeley.edu/jenkins/job/sknapp-testing-spark-branch-2.4-test-maven-hadoop-2.7/12/

@shaneknapp
Copy link
Contributor Author

mvn clean package script logic worked!

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15:11 min
[INFO] Finished at: 2018-10-26T10:01:13-07:00
[INFO] ------------------------------------------------------------------------
+ MVN_RETCODE=0
+ /home/jenkins/workspace/sknapp-testing-spark-branch-2.4-test-maven-hadoop-2.7/build/zinc-0.3.15/bin/zinc -shutdown -port 3087
+ exit 0     <--------------  this is from "exit $MVN_RETCODE"
+ retcode1=0

@vanzin
Copy link
Contributor

vanzin commented Oct 26, 2018

Probably unnecessary to change the timeout, but LGTM.

build/mvn Outdated
# Try to shut down zinc explicitly if the server is still running. if it's not running,
# it's timed out and we'll still need to exit the script w/a 0 to keep the build from
# failing.
"${ZINC_BIN}" -shutdown -port ${ZINC_PORT} || true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we still need || true? we always return $MVN_RETCODE now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably don't need it, but i am more than comfortable keeping it in there #justincase

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright, i tested the script w/a false call in the mvn helper script and nothing broke. pushed a change removing || true.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM.

Thank you, @shaneknapp . I also wondered the reason of these failures. BTW, could you update the title a little bit? For example,

[SPARK-25854] fix mvn to not always exit 1
[SPARK-25854][BUILD] Fix `build/mvn` not to fail during Zinc server shutdown

@shaneknapp shaneknapp changed the title [SPARK-25854] fix mvn to not always exit 1 [SPARK-25854][BUILD] fix build/mvn not to fail during Zinc server shutdown Oct 26, 2018
@shaneknapp
Copy link
Contributor Author

shaneknapp commented Oct 26, 2018

let's not merge until this build passes:
https://amplab.cs.berkeley.edu/jenkins/job/sknapp-testing-spark-branch-2.4-test-maven-hadoop-2.7/12/

(i hacked this build to scp the updated mvn helper script over before compilation starts)

@shaneknapp
Copy link
Contributor Author

Merged build finished. Test FAILed.

that was me killing the 1st PRB build

@shaneknapp
Copy link
Contributor Author

build is green, and everything looks to be behaving normally!

https://amplab.cs.berkeley.edu/jenkins/job/sknapp-testing-spark-branch-2.4-test-maven-hadoop-2.7/12/console

ready to merge and backport (@srowen could you help out w/this one?)

@SparkQA
Copy link

SparkQA commented Oct 26, 2018

Test build #98104 has finished for PR 22854 at commit 3d32b61.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can merge and backport. The last test failure is spurious.

@shaneknapp
Copy link
Contributor Author

yeah... wasn't worried about the PRB failing. thanks for the merge/backport!

asfgit pushed a commit that referenced this pull request Oct 26, 2018
…hutdown

## What changes were proposed in this pull request?

the final line in the mvn helper script in build/ attempts to shut down the zinc server.  due to the zinc server being set up w/a 30min timeout, by the time the mvn test instantiation finishes, the server times out.

this means that when the mvn script tries to shut down zinc, it returns w/an exit code of 1.  this will then automatically fail the entire build (even if the build passes).

## How was this patch tested?

i set up a test build:
https://amplab.cs.berkeley.edu/jenkins/job/sknapp-testing-spark-branch-2.4-test-maven-hadoop-2.7/

Closes #22854 from shaneknapp/fix-mvn-helper-script.

Authored-by: shane knapp <[email protected]>
Signed-off-by: Sean Owen <[email protected]>
(cherry picked from commit 6aa5063)
Signed-off-by: Sean Owen <[email protected]>
asfgit pushed a commit that referenced this pull request Oct 26, 2018
…hutdown

the final line in the mvn helper script in build/ attempts to shut down the zinc server.  due to the zinc server being set up w/a 30min timeout, by the time the mvn test instantiation finishes, the server times out.

this means that when the mvn script tries to shut down zinc, it returns w/an exit code of 1.  this will then automatically fail the entire build (even if the build passes).

i set up a test build:
https://amplab.cs.berkeley.edu/jenkins/job/sknapp-testing-spark-branch-2.4-test-maven-hadoop-2.7/

Closes #22854 from shaneknapp/fix-mvn-helper-script.

Authored-by: shane knapp <[email protected]>
Signed-off-by: Sean Owen <[email protected]>
(cherry picked from commit 6aa5063)
Signed-off-by: Sean Owen <[email protected]>
@asfgit asfgit closed this in 6aa5063 Oct 26, 2018
asfgit pushed a commit that referenced this pull request Oct 26, 2018
…hutdown

the final line in the mvn helper script in build/ attempts to shut down the zinc server.  due to the zinc server being set up w/a 30min timeout, by the time the mvn test instantiation finishes, the server times out.

this means that when the mvn script tries to shut down zinc, it returns w/an exit code of 1.  this will then automatically fail the entire build (even if the build passes).

i set up a test build:
https://amplab.cs.berkeley.edu/jenkins/job/sknapp-testing-spark-branch-2.4-test-maven-hadoop-2.7/

Closes #22854 from shaneknapp/fix-mvn-helper-script.

Authored-by: shane knapp <[email protected]>
Signed-off-by: Sean Owen <[email protected]>
(cherry picked from commit 6aa5063)
Signed-off-by: Sean Owen <[email protected]>
@SparkQA
Copy link

SparkQA commented Oct 26, 2018

Test build #98103 has finished for PR 22854 at commit 45bb7b0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

jackylee-ch pushed a commit to jackylee-ch/spark that referenced this pull request Feb 18, 2019
…hutdown

## What changes were proposed in this pull request?

the final line in the mvn helper script in build/ attempts to shut down the zinc server.  due to the zinc server being set up w/a 30min timeout, by the time the mvn test instantiation finishes, the server times out.

this means that when the mvn script tries to shut down zinc, it returns w/an exit code of 1.  this will then automatically fail the entire build (even if the build passes).

## How was this patch tested?

i set up a test build:
https://amplab.cs.berkeley.edu/jenkins/job/sknapp-testing-spark-branch-2.4-test-maven-hadoop-2.7/

Closes apache#22854 from shaneknapp/fix-mvn-helper-script.

Authored-by: shane knapp <[email protected]>
Signed-off-by: Sean Owen <[email protected]>
@shaneknapp shaneknapp deleted the fix-mvn-helper-script branch April 19, 2019 17:35
kai-chi pushed a commit to kai-chi/spark that referenced this pull request Aug 1, 2019
…hutdown

## What changes were proposed in this pull request?

the final line in the mvn helper script in build/ attempts to shut down the zinc server.  due to the zinc server being set up w/a 30min timeout, by the time the mvn test instantiation finishes, the server times out.

this means that when the mvn script tries to shut down zinc, it returns w/an exit code of 1.  this will then automatically fail the entire build (even if the build passes).

## How was this patch tested?

i set up a test build:
https://amplab.cs.berkeley.edu/jenkins/job/sknapp-testing-spark-branch-2.4-test-maven-hadoop-2.7/

Closes apache#22854 from shaneknapp/fix-mvn-helper-script.

Authored-by: shane knapp <[email protected]>
Signed-off-by: Sean Owen <[email protected]>
(cherry picked from commit 6aa5063)
Signed-off-by: Sean Owen <[email protected]>
Willymontaz pushed a commit to criteo-forks/spark that referenced this pull request Sep 26, 2019
…hutdown

the final line in the mvn helper script in build/ attempts to shut down the zinc server.  due to the zinc server being set up w/a 30min timeout, by the time the mvn test instantiation finishes, the server times out.

this means that when the mvn script tries to shut down zinc, it returns w/an exit code of 1.  this will then automatically fail the entire build (even if the build passes).

i set up a test build:
https://amplab.cs.berkeley.edu/jenkins/job/sknapp-testing-spark-branch-2.4-test-maven-hadoop-2.7/

Closes apache#22854 from shaneknapp/fix-mvn-helper-script.

Authored-by: shane knapp <[email protected]>
Signed-off-by: Sean Owen <[email protected]>
(cherry picked from commit 6aa5063)
Signed-off-by: Sean Owen <[email protected]>
Willymontaz pushed a commit to criteo-forks/spark that referenced this pull request Sep 27, 2019
…hutdown

the final line in the mvn helper script in build/ attempts to shut down the zinc server.  due to the zinc server being set up w/a 30min timeout, by the time the mvn test instantiation finishes, the server times out.

this means that when the mvn script tries to shut down zinc, it returns w/an exit code of 1.  this will then automatically fail the entire build (even if the build passes).

i set up a test build:
https://amplab.cs.berkeley.edu/jenkins/job/sknapp-testing-spark-branch-2.4-test-maven-hadoop-2.7/

Closes apache#22854 from shaneknapp/fix-mvn-helper-script.

Authored-by: shane knapp <[email protected]>
Signed-off-by: Sean Owen <[email protected]>
(cherry picked from commit 6aa5063)
Signed-off-by: Sean Owen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants