IMPALA-4540: Function call in DCHECK crashes scheduler

The fix for IMPALA-4494 wrapped the call to
backend_config_.LookUpBackendIp in simple-scheduler.cc:922 in a DCHECK,
effectively disabling it in release builds. This leads to a crash when
backend_ip is empty.

This change makes sure that the function is always called.

Change-Id: Iefbf719e86a59c09c45a5418f6ec0aa5cc4d8c44
Reviewed-on: http://gerrit.cloudera.org:8080/5218
Reviewed-by: Michael Ho <[email protected]>
Tested-by: Internal Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/3c65fa1d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/3c65fa1d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/3c65fa1d

Branch: refs/heads/master
Commit: 3c65fa1d7e91177770d745940e84645cf9c49ba8
Parents: fc61f2a
Author: Lars Volker <[email protected]>
Authored: Thu Nov 24 22:02:31 2016 +0100
Committer: Internal Jenkins <[email protected]>
Committed: Fri Nov 25 15:26:48 2016 +0000

----------------------------------------------------------------------
 be/src/scheduling/simple-scheduler.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/3c65fa1d/be/src/scheduling/simple-scheduler.cc
----------------------------------------------------------------------
diff --git a/be/src/scheduling/simple-scheduler.cc 
b/be/src/scheduling/simple-scheduler.cc
index 1c8af72..a0b4a35 100644
--- a/be/src/scheduling/simple-scheduler.cc
+++ b/be/src/scheduling/simple-scheduler.cc
@@ -919,7 +919,8 @@ void 
SimpleScheduler::AssignmentCtx::RecordScanRangeAssignment(
   }
 
   IpAddr backend_ip;
-  DCHECK(backend_config_.LookUpBackendIp(backend.address.hostname, 
&backend_ip));
+  bool ret = backend_config_.LookUpBackendIp(backend.address.hostname, 
&backend_ip);
+  DCHECK(ret);
   DCHECK(!backend_ip.empty());
   assignment_heap_.InsertOrUpdate(backend_ip, scan_range_length,
       GetBackendRank(backend_ip));

Reply via email to