You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Tianyi Wang (Code Review)" <ge...@cloudera.org> on 2017/08/10 17:34:03 UTC
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Tianyi Wang has uploaded a new change for review.
http://gerrit.cloudera.org:8080/7642
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
IMPALA-5327: Handle return of JNI GetStringUTFChar
GetStringUTFChars may return NULL or throw exception and it is not
handled in two places. This patch checks the return value/exception,
logs if there is error and return error to the caller.
Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
---
M be/src/util/jni-util.cc
M be/src/util/logging-support.cc
2 files changed, 34 insertions(+), 11 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/42/7642/1
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change.
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
Patch Set 12:
Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/1077/
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 12
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tim Armstrong (Code Review)" <ge...@cloudera.org>.
Tim Armstrong has posted comments on this change.
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
Patch Set 1:
(5 comments)
http://gerrit.cloudera.org:8080/#/c/7642/1/be/src/util/jni-util.cc
File be/src/util/jni-util.cc:
Line 183: LOG_AT_LEVEL(google::FATAL) << get_str_fail_message;
LOG(FATAL) actually kills the process. How about LOG(ERROR) instead?
PS1, Line 184: MEM_ALLOC_FAILED
This error message requires a parameter (see the string in common/thrift/generate_error_codes.py). How about just returning Status(get_str_fail_message);
Line 193: LOG_AT_LEVEL(google::FATAL) << get_str_fail_message;
Same here.
PS1, Line 202: prefix + msg_str)
We usually prefer Substitute() for cases like this. E.g.
return Status(Substitute("$0: $1", prefix, msg_str));
http://gerrit.cloudera.org:8080/#/c/7642/1/be/src/util/logging-support.cc
File be/src/util/logging-support.cc:
Line 48: auto get_str_fail_message = "GetStringUTFChars failed. Probable OOM on JVM side";
Same comments here. How about we add a function to the JNIUtil class that does this to avoid repeating the logic. E.g.
Status GetStringUTFChars(....);
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change.
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
Patch Set 12: Verified+1
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 12
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tim Armstrong (Code Review)" <ge...@cloudera.org>.
Tim Armstrong has posted comments on this change.
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
Patch Set 7:
(4 comments)
Yeah, we use Status almost universally for error handling. We don't currently distinguish very clearly between internal-only status codes and user-visible status codes.
Thanks for adding this class, should make this error handling less error-prone.
http://gerrit.cloudera.org:8080/#/c/7642/7/be/src/util/jni-util.cc
File be/src/util/jni-util.cc:
PS7, Line 32: auto
Might as well declare it as 'bool', it's the same number of characters.
http://gerrit.cloudera.org:8080/#/c/7642/7/be/src/util/jni-util.h
File be/src/util/jni-util.h:
PS7, Line 145: Jni
JNI?
Line 148: JNIEnv* env;
Are these meant to be private? Usually our convention is to have a private: section below the public interface.
Line 166: const char* get() { return utf_chars; }
We should add a DISALLOW_COPY_AND_ASSIGN(JniUtfCharGuard); to disable the copy constructors (weird things would happen).
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 7
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tim Armstrong (Code Review)" <ge...@cloudera.org>.
Tim Armstrong has posted comments on this change.
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
Patch Set 10:
This failed in authorization/test_authorization.py::TestAuthorization::()::test_impersonation
I don't think we've seen a failure there before so it may be related to the change.
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 10
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has uploaded a new patch set (#7).
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
IMPALA-5327: Handle return of JNI GetStringUTFChar
GetStringUTFChars may return NULL or throw exception and it is not
handled in two places. This patch checks the return value/exception,
logs if there is error and return error to the caller. A helper class
JniUtfCharGuard is added to jni-util.h/cc to manage the lifetime.
Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
---
M be/src/common/status.h
M be/src/util/jni-util.cc
M be/src/util/jni-util.h
M be/src/util/logging-support.cc
4 files changed, 69 insertions(+), 27 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/42/7642/7
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 7
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tim Armstrong (Code Review)" <ge...@cloudera.org>.
Tim Armstrong has posted comments on this change.
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
Patch Set 3:
(7 comments)
http://gerrit.cloudera.org:8080/#/c/7642/3/be/src/util/jni-util.cc
File be/src/util/jni-util.cc:
Line 186: env->ReleaseStringUTFChars(msg, msg_str);
We're doing this on every exit path out of the function. How about using the ScopeExitTrigger utility?
Or, even better, could we make a utility class that holds the UTF chars and automatically releases them in the destructor?
Line 212: jboolean dummy;
We may not need the dummy variable. The docs say: "If isCopy is not NULL, then *isCopy is set to JNI_TRUE if a copy is made; or it is set to JNI_FALSE if no copy is made."
http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/functions.html
Line 215: if (env->ExceptionCheck()) {
Can put this conditional on one line.
Line 218: if (result != nullptr) {
Same here.
Line 225: return Status::OK();
We can unnest the contents of this else. I.e.
if (...) {
...
return Status(fail_message);
}
return Status::OK().
We generally favour doing this in the codebase to get more concise code.
http://gerrit.cloudera.org:8080/#/c/7642/3/be/src/util/jni-util.h
File be/src/util/jni-util.h:
Line 236: /// error Status.
Should mention that the caller is required to free 'result' in a specific way.
PS3, Line 237: const char*&
Output argument should be a pointer instead of a reference: https://google.github.io/styleguide/cppguide.html#Reference_Arguments
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has uploaded a new patch set (#4).
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
IMPALA-5327: Handle return of JNI GetStringUTFChar
GetStringUTFChars may return NULL or throw exception and it is not
handled in two places. This patch checks the return value/exception,
logs if there is error and return error to the caller. A helper class
JniUtfCharGuard is added to jni-util.h/cc to manage the lifetime.
Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
---
M be/src/common/status.h
M be/src/util/jni-util.cc
M be/src/util/jni-util.h
M be/src/util/logging-support.cc
4 files changed, 68 insertions(+), 26 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/42/7642/4
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has uploaded a new patch set (#8).
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
IMPALA-5327: Handle return of JNI GetStringUTFChar
GetStringUTFChars may return NULL or throw exception and it is not
handled in two places. This patch checks the return value/exception,
logs if there is error and return error to the caller. A helper class
JniUtfCharGuard is added to jni-util.h/cc to manage the lifetime.
Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
---
M be/src/common/status.h
M be/src/util/jni-util.cc
M be/src/util/jni-util.h
M be/src/util/logging-support.cc
4 files changed, 71 insertions(+), 27 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/42/7642/8
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 8
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Hello Tim Armstrong,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/7642
to look at the new patch set (#9).
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
IMPALA-5327: Handle return of JNI GetStringUTFChar
GetStringUTFChars may return NULL or throw exception and it is not
handled in two places. This patch checks the return value/exception,
logs if there is error and return error to the caller. A helper class
JniUtfCharGuard is added to jni-util.h/cc to manage the lifetime.
Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
---
M be/src/common/status.h
M be/src/util/jni-util.cc
M be/src/util/jni-util.h
M be/src/util/logging-support.cc
4 files changed, 68 insertions(+), 26 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/42/7642/9
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 9
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has uploaded a new patch set (#3).
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
IMPALA-5327: Handle return of JNI GetStringUTFChar
GetStringUTFChars may return NULL or throw exception and it is not
handled in two places. This patch checks the return value/exception,
logs if there is error and return error to the caller.
Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
---
M be/src/util/jni-util.cc
M be/src/util/jni-util.h
M be/src/util/logging-support.cc
3 files changed, 49 insertions(+), 16 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/42/7642/3
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has posted comments on this change.
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
Patch Set 10:
> (2 comments)
>
> Looks good. If you fix the last couple of nits and rebase I can
> start the merge.
Done
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 10
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has submitted this change and it was merged.
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
IMPALA-5327: Handle return of JNI GetStringUTFChar
GetStringUTFChars may return NULL or throw exception and it is not
handled in two places. This patch checks the return value/exception,
logs if there is error and return error to the caller. A helper class
JniUtfCharGuard is added to jni-util.h/cc to manage the lifetime.
Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Reviewed-on: http://gerrit.cloudera.org:8080/7642
Reviewed-by: Tim Armstrong <ta...@cloudera.com>
Tested-by: Impala Public Jenkins
---
M be/src/common/status.h
M be/src/util/jni-util.cc
M be/src/util/jni-util.h
M be/src/util/logging-support.cc
4 files changed, 69 insertions(+), 26 deletions(-)
Approvals:
Impala Public Jenkins: Verified
Tim Armstrong: Looks good to me, approved
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 13
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has posted comments on this change.
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
Patch Set 11:
> This failed in authorization/test_authorization.py::TestAuthorization::()::test_impersonation
>
> I don't think we've seen a failure there before so it may be
> related to the change.
Fixed. The "Substitute" in GetJniExceptionMsg caused this bug. It seems the audit log relies on this message to be intact.
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 11
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Hello Impala Public Jenkins, Tim Armstrong,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/7642
to look at the new patch set (#11).
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
IMPALA-5327: Handle return of JNI GetStringUTFChar
GetStringUTFChars may return NULL or throw exception and it is not
handled in two places. This patch checks the return value/exception,
logs if there is error and return error to the caller. A helper class
JniUtfCharGuard is added to jni-util.h/cc to manage the lifetime.
Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
---
M be/src/common/status.h
M be/src/util/jni-util.cc
M be/src/util/jni-util.h
M be/src/util/logging-support.cc
4 files changed, 72 insertions(+), 27 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/42/7642/11
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 11
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tim Armstrong (Code Review)" <ge...@cloudera.org>.
Tim Armstrong has posted comments on this change.
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
Patch Set 11:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/7642/11/be/src/util/logging-support.cc
File be/src/util/logging-support.cc:
Line 51: str = msg_guard.get();
I think you reverted some changes you made in an earlier iteration.
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 11
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tim Armstrong (Code Review)" <ge...@cloudera.org>.
Tim Armstrong has posted comments on this change.
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
Patch Set 8: Code-Review+2
(2 comments)
Looks good. If you fix the last couple of nits and rebase I can start the merge.
http://gerrit.cloudera.org:8080/#/c/7642/8/be/src/util/jni-util.h
File be/src/util/jni-util.h:
Line 164: DISALLOW_COPY_AND_ASSIGN(JniUtfCharGuard);
Nit: move it inside 'private'.
http://gerrit.cloudera.org:8080/#/c/7642/8/be/src/util/logging-support.cc
File be/src/util/logging-support.cc:
Line 53: str = "";
Nit: seems simpler to just initialise it to point to the empty string constant like it was before.
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 8
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change.
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
Patch Set 10: Verified-1
Build failed: https://jenkins.impala.io/job/gerrit-verify-dryrun/1050/
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 10
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has posted comments on this change.
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
Patch Set 3:
> (5 comments)
Comments addressed. The code is still a little redundant for resource releasing
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has uploaded a new patch set (#5).
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
IMPALA-5327: Handle return of JNI GetStringUTFChar
GetStringUTFChars may return NULL or throw exception and it is not
handled in two places. This patch checks the return value/exception,
logs if there is error and return error to the caller. A helper class
JniUtfCharGuard is added to jni-util.h/cc to manage the lifetime.
Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
---
M be/src/common/status.h
M be/src/util/jni-util.cc
M be/src/util/jni-util.h
M be/src/util/logging-support.cc
4 files changed, 68 insertions(+), 26 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/42/7642/5
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tim Armstrong (Code Review)" <ge...@cloudera.org>.
Tim Armstrong has posted comments on this change.
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
Patch Set 12: Code-Review+2
(1 comment)
http://gerrit.cloudera.org:8080/#/c/7642/11/be/src/util/logging-support.cc
File be/src/util/logging-support.cc:
Line 51: str = msg_guard.get();
> Done. I made that change in we browser which is not a good idea.
Yeah I never really understood the use-case for the edit functionality in gerrit.
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 12
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has uploaded a new patch set (#6).
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
IMPALA-5327: Handle return of JNI GetStringUTFChar
GetStringUTFChars may return NULL or throw exception and it is not
handled in two places. This patch checks the return value/exception,
logs if there is error and return error to the caller. A helper class
JniUtfCharGuard is added to jni-util.h/cc to manage the lifetime.
Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
---
M be/src/common/status.h
M be/src/util/jni-util.cc
M be/src/util/jni-util.h
M be/src/util/logging-support.cc
4 files changed, 69 insertions(+), 27 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/42/7642/6
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 6
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has posted comments on this change.
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
Patch Set 11:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/7642/11/be/src/util/logging-support.cc
File be/src/util/logging-support.cc:
Line 51: str = msg_guard.get();
> I think you reverted some changes you made in an earlier iteration.
Done. I made that change in we browser which is not a good idea.
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 11
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has posted comments on this change.
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
Patch Set 11:
> (1 comment)
web browser
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 11
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Hello Impala Public Jenkins, Tim Armstrong,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/7642
to look at the new patch set (#12).
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
IMPALA-5327: Handle return of JNI GetStringUTFChar
GetStringUTFChars may return NULL or throw exception and it is not
handled in two places. This patch checks the return value/exception,
logs if there is error and return error to the caller. A helper class
JniUtfCharGuard is added to jni-util.h/cc to manage the lifetime.
Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
---
M be/src/common/status.h
M be/src/util/jni-util.cc
M be/src/util/jni-util.h
M be/src/util/logging-support.cc
4 files changed, 69 insertions(+), 26 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/42/7642/12
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 12
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has posted comments on this change.
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
Patch Set 6:
D
> (7 comments)
Done(Test is still ongoing). I have a question: when doing error handling that is not exposed to user/Thrift, is Status class recommended to use? It seems its untyped style is mainly for Thrift transmission.
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 6
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change.
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
Patch Set 10:
Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/1050/
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 10
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tim Armstrong (Code Review)" <ge...@cloudera.org>.
Tim Armstrong has posted comments on this change.
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
Patch Set 10: Code-Review+2
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 10
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has posted comments on this change.
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
Patch Set 8:
> (4 comments)
>
> Yeah, we use Status almost universally for error handling. We don't
> currently distinguish very clearly between internal-only status
> codes and user-visible status codes.
>
> Thanks for adding this class, should make this error handling less
> error-prone.
Done
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 8
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-5327: Handle return of JNI GetStringUTFChar
Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has uploaded a new patch set (#2).
Change subject: IMPALA-5327: Handle return of JNI GetStringUTFChar
......................................................................
IMPALA-5327: Handle return of JNI GetStringUTFChar
GetStringUTFChars may return NULL or throw exception and it is not
handled in two places. This patch checks the return value/exception,
logs if there is error and return error to the caller.
Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
---
M be/src/util/jni-util.cc
M be/src/util/jni-util.h
M be/src/util/logging-support.cc
3 files changed, 47 insertions(+), 16 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/42/7642/2
--
To view, visit http://gerrit.cloudera.org:8080/7642
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I47eed045f21c6ed3a8decf422ce8429fc66c4322
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>