Skip to content

[SPARK-3547]Using a special exit code instead of 1 to represent ClassNotFoundExcepti... #2421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

WangTaoTheTonic
Copy link
Contributor

...on

As improvement of #1944, we should use more special exit code to represent ClassNotFoundException.

@WangTaoTheTonic WangTaoTheTonic changed the title Using a special exit code instead of 1 to represent ClassNotFoundExcepti... [SPARK-3547]Using a special exit code instead of 1 to represent ClassNotFoundExcepti... Sep 17, 2014
@SparkQA
Copy link

SparkQA commented Sep 17, 2014

QA tests have started for PR 2421 at commit fbb232f.

  • This patch merges cleanly.

@WangTaoTheTonic
Copy link
Contributor Author

@liancheng What do you think?

@SparkQA
Copy link

SparkQA commented Sep 17, 2014

Tests timed out after a configured wait of 120m.

@liancheng
Copy link
Contributor

Hmm, considering that SparkSubmit can be used to start any user application, which may call System.exit(Int) at any time with an arbitrary integer, it can a good idea to pick a more special exit code. LGTM.

@liancheng
Copy link
Contributor

test this please

@@ -27,7 +27,7 @@ set -o posix
FWDIR="$(cd "`dirname "$0"`"/..; pwd)"

CLASS="org.apache.spark.sql.hive.thriftserver.HiveThriftServer2"
CLASS_NOT_FOUND_EXIT_STATUS=1
CLASS_NOT_FOUND_EXIT_STATUS=1024
Copy link
Member

Choose a reason for hiding this comment

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

Exit code should be between 0 - 255. It's Bash's specification.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, good point! The integer is converted to an unsigned byte under bash. And for 1024, the converted value is actually 0, which is definitely not acceptable... Maybe some prime number like 251 instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

Please keep error codes < 128. From http://en.wikipedia.org/wiki/Exit_status:

When a command terminates on a fatal signal whose number is N, Bash uses the value 128+N as the exit status.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the reference! Good to know, didn't know these specific rules before.

@WangTaoTheTonic
Copy link
Contributor Author

Use 127 instead, it is the biggest prime number in those less than 128.

How about it, guys?

@SparkQA
Copy link

SparkQA commented Sep 18, 2014

QA tests have started for PR 2421 at commit a2d6465.

  • This patch merges cleanly.

@liancheng
Copy link
Contributor

@WangTaoTheTonic According to the wiki page @vanzin pointed out, values above 125 are used by bash for special purposes. Since the purpose of this PR is to reduce the possibility of exit code collision, just choose any value that is not too common and doesn't violate bash rules, not necessary to be prime :)

@WangTaoTheTonic
Copy link
Contributor Author

Sorry for not noticing "If a command is not found, the child process created to execute it returns a status of 127. If a command is found but is not executable, the return status is 126".

Now using 101.

@SparkQA
Copy link

SparkQA commented Sep 18, 2014

QA tests have started for PR 2421 at commit d6ae559.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Sep 18, 2014

QA tests have finished for PR 2421 at commit a2d6465.

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

@SparkQA
Copy link

SparkQA commented Sep 18, 2014

QA tests have finished for PR 2421 at commit d6ae559.

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

@WangTaoTheTonic
Copy link
Contributor Author

Gosh, the test failed. I looked "block generator throttling" in NetworkReceiverSuite.scala but couldn't see why.

@pwendell
Copy link
Contributor

Jenkins, test this please.

@SparkQA
Copy link

SparkQA commented Sep 18, 2014

QA tests have started for PR 2421 at commit d6ae559.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Sep 18, 2014

QA tests have finished for PR 2421 at commit d6ae559.

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

@SparkQA
Copy link

SparkQA commented Sep 18, 2014

QA tests have started for PR 2421 at commit 645a22a.

  • This patch merges cleanly.

@sarutak
Copy link
Member

sarutak commented Sep 18, 2014

@WangTaoTheTonic You can let Jenkins works by saying like "retest this please" or "test this please" without extra push.

@SparkQA
Copy link

SparkQA commented Sep 18, 2014

QA tests have started for PR 2421 at commit 645a22a.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Sep 18, 2014

QA tests have finished for PR 2421 at commit 645a22a.

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

@WangTaoTheTonic
Copy link
Contributor Author

@sarutak Thanks I see, thought only commiters can do it this way.

@SparkQA
Copy link

SparkQA commented Sep 18, 2014

QA tests have finished for PR 2421 at commit 645a22a.

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

@asfgit asfgit closed this in 3447d10 Sep 18, 2014
@liancheng
Copy link
Contributor

@sarutak Actually Jenkins only listens to a limited group of people, and sometimes he even ignores this group for unknown reasons. Lots of work led by Josh had been done in the past weeks to make Jenkins happy, I think he'll be much more friendly and responsive soon :)

@sarutak
Copy link
Member

sarutak commented Sep 19, 2014

@liancheng Ah, I saw sometimes Jenkins ignores us... but recently he is friendly :D

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