Alex Behm has posted comments on this change. Change subject: IMPALA-3854: Fix use-after-free in HdfsTextScanner::Close() ......................................................................
Patch Set 3: (5 comments) http://gerrit.cloudera.org:8080/#/c/3630/3/be/src/exec/hdfs-scan-node.cc File be/src/exec/hdfs-scan-node.cc: Line 1225: // Even though the Stream objects in the ScannerContext are destroyed implicitly after making the suggested changes I think we can remove this comment Line 1250: // Release streams explicitly here for clarity. after making the suggested changes I think we can remove this comment http://gerrit.cloudera.org:8080/#/c/3630/3/be/src/exec/hdfs-scanner.cc File be/src/exec/hdfs-scanner.cc: PS3, Line 213: why did you remove this? http://gerrit.cloudera.org:8080/#/c/3630/3/be/src/exec/scanner-context.cc File be/src/exec/scanner-context.cc: Line 69: std::unique_ptr<Stream> stream(new Stream(this)); I think it may be better to have a regular pointer here to avoid implicit destruction, and force us to properly call ClearStreams(). In addition, we should add a DCHECK in the destructor of ScannerContext() that makes sure that streams_ is empty(). http://gerrit.cloudera.org:8080/#/c/3630/3/be/src/exec/scanner-context.h File be/src/exec/scanner-context.h: Line 286: void ReleaseAllStreams(); ClearStreams()? -- To view, visit http://gerrit.cloudera.org:8080/3630 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia88f6285563ff669ae215af22ed2d45e5398adae Gerrit-PatchSet: 3 Gerrit-Project: Impala Gerrit-Branch: cdh5-trunk Gerrit-Owner: Michael Ho <[email protected]> Gerrit-Reviewer: Alex Behm <[email protected]> Gerrit-Reviewer: Michael Ho <[email protected]> Gerrit-HasComments: Yes
