Dan Hecht has posted comments on this change. Change subject: IMPALA-3385: Fix crashes on accessing error_log ......................................................................
Patch Set 5: (1 comment) http://gerrit.cloudera.org:8080/#/c/2829/5/be/src/util/error-util.cc File be/src/util/error-util.cc: Line 135: if (v.second.count == 0) continue; > I did in AppendError(), I +1 for count for any kind of error. so this count It doesn't make sense to increment count for general errors because we have a different message for each, so that information is already encoded somewhere else. Redundant state is bad -- it just provides an opportunity for bugs. As stated earlier, let's make the invariant for each map entry be: GENERAL: count == 0, messages.size() > 0 others: count > 0, messages.size() == 1 Then the code will be easy to reason about. -- To view, visit http://gerrit.cloudera.org:8080/2829 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3a7e3d22e26147ada780aae5aed1f2e25a515afc Gerrit-PatchSet: 5 Gerrit-Project: Impala Gerrit-Branch: cdh5-trunk Gerrit-Owner: Huaisi Xu <[email protected]> Gerrit-Reviewer: Bharath Vissapragada <[email protected]> Gerrit-Reviewer: Dan Hecht <[email protected]> Gerrit-Reviewer: Huaisi Xu <[email protected]> Gerrit-HasComments: Yes
