You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Anonymous Coward (Code Review)" <ge...@cloudera.org> on 2020/04/01 03:52:35 UTC

[kudu-CR] KUDU-3099: Remove System.exit() calls in KuduBackup/KuduRestore

waleed.fateem@gmail.com has uploaded this change for review. ( http://gerrit.cloudera.org:8080/15626


Change subject: KUDU-3099: Remove System.exit() calls in KuduBackup/KuduRestore
......................................................................

KUDU-3099: Remove System.exit() calls in KuduBackup/KuduRestore

The System.exit() calls have a side effect that can cause Spark to fail even
if the run function returns 0 on success. Rather then calling System.exit()
throw a RuntimeException if a non 0 code was returned by run() and stop
Spark cleanly using SparkSession's stop() method.

Change-Id: Iafcab9ef456b6f50357b8840a1eecc95f753513b
---
M java/kudu-backup/src/main/scala/org/apache/kudu/backup/KuduBackup.scala
M java/kudu-backup/src/main/scala/org/apache/kudu/backup/KuduRestore.scala
2 files changed, 10 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/26/15626/1
-- 
To view, visit http://gerrit.cloudera.org:8080/15626
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iafcab9ef456b6f50357b8840a1eecc95f753513b
Gerrit-Change-Number: 15626
Gerrit-PatchSet: 1
Gerrit-Owner: Anonymous Coward <wa...@gmail.com>

[kudu-CR] KUDU-3099: Remove System.exit() calls in KuduBackup/KuduRestore

Posted by "Grant Henke (Code Review)" <ge...@cloudera.org>.
Grant Henke has abandoned this change. ( http://gerrit.cloudera.org:8080/15626 )

Change subject: KUDU-3099: Remove System.exit() calls in KuduBackup/KuduRestore
......................................................................


Abandoned

Superseded by https://gerrit.cloudera.org/#/c/15638/
-- 
To view, visit http://gerrit.cloudera.org:8080/15626
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: Iafcab9ef456b6f50357b8840a1eecc95f753513b
Gerrit-Change-Number: 15626
Gerrit-PatchSet: 1
Gerrit-Owner: Anonymous Coward <wa...@gmail.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] KUDU-3099: Remove System.exit() calls in KuduBackup/KuduRestore

Posted by "Grant Henke (Code Review)" <ge...@cloudera.org>.
Grant Henke has posted comments on this change. ( http://gerrit.cloudera.org:8080/15626 )

Change subject: KUDU-3099: Remove System.exit() calls in KuduBackup/KuduRestore
......................................................................


Patch Set 1:

(2 comments)

I understand unit testing this change is difficult. Could you add a comment in the commit message noting if this resolved this issue you reported in the real environment?

http://gerrit.cloudera.org:8080/#/c/15626/1/java/kudu-backup/src/main/scala/org/apache/kudu/backup/KuduBackup.scala
File java/kudu-backup/src/main/scala/org/apache/kudu/backup/KuduBackup.scala:

http://gerrit.cloudera.org:8080/#/c/15626/1/java/kudu-backup/src/main/scala/org/apache/kudu/backup/KuduBackup.scala@175
PS1, Line 175:     val runReturnCode: Int = run(options, session)
Maybe change the run function to return a boolean and make this:

   bool success = run(options, session)
   if (!success)...

Same for the restore class.


http://gerrit.cloudera.org:8080/#/c/15626/1/java/kudu-backup/src/main/scala/org/apache/kudu/backup/KuduBackup.scala@176
PS1, Line 176:     if (runReturnCode != 0)
nit: always use braces in the if statement.



-- 
To view, visit http://gerrit.cloudera.org:8080/15626
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iafcab9ef456b6f50357b8840a1eecc95f753513b
Gerrit-Change-Number: 15626
Gerrit-PatchSet: 1
Gerrit-Owner: Anonymous Coward <wa...@gmail.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 01 Apr 2020 04:03:38 +0000
Gerrit-HasComments: Yes