Tim Armstrong has posted comments on this change. ( http://gerrit.cloudera.org:8080/15050 )
Change subject: IMPALA-9291: MemTracker's TryConsume() should behave consistent with Consume()/Release() ...................................................................... Patch Set 1: Code-Review+2 (2 comments) Thanks for cleaning this up, it helps to have stricter invariants in code like this. I had one suggestion but very happy with the code change as-is. http://gerrit.cloudera.org:8080/#/c/15050/1/be/src/runtime/mem-tracker.h File be/src/runtime/mem-tracker.h: http://gerrit.cloudera.org:8080/#/c/15050/1/be/src/runtime/mem-tracker.h@171 PS1, Line 171: DCHECK_GE(bytes, 0); : DCHECK(!closed_) << label_; : if (consumption_metric_ != nullptr) RefreshConsumptionFromMetric(); : if (UNLIKELY(bytes == 0)) return true; > I agree with adding the DCHECK to catch such calls during tests, but I am c I'd consider removing the bytes == 0 special case, since it's not common so not worth optimising and the code below should handle it fine. (Not that important, OK to ignore) http://gerrit.cloudera.org:8080/#/c/15050/1/be/src/runtime/mem-tracker.h@215 PS1, Line 215: if (bytes == 0) return; Same here - consider removing the special case. -- To view, visit http://gerrit.cloudera.org:8080/15050 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I22e613c49e4a6bd218e7f7f7c0d6bec95b75cff5 Gerrit-Change-Number: 15050 Gerrit-PatchSet: 1 Gerrit-Owner: Zoltan Borok-Nagy <[email protected]> Gerrit-Reviewer: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Norbert Luksa <[email protected]> Gerrit-Reviewer: Tim Armstrong <[email protected]> Gerrit-Comment-Date: Thu, 16 Jan 2020 17:19:07 +0000 Gerrit-HasComments: Yes
