Always signal HdfsScanNode::row_batch_added_cv_ while holding row_batches_lock_
Always signal HdfsScanNode::row_batch_added_cv_ while holding row_batches_lock_

HdfsScanNode::GetNext waits on row_batch_added_cv_ while holding row_batches_lock_, but
the error path in ScannerThreadHelper does not take row_batches_lock_ while setting the
associated condition (done_ == true) or signalling the cv itself. This leads to the
possibility of a race when GetNext might be spuriously awake and between checking done_ ==
true and rewaiting for the cv. Holding the lock while setting done_ also guarantees
visibility between the two threads.

Change-Id: Iad050fcd4302240cae2074ae4f2a1d64f3eaafe3
Reviewed-on: http://gerrit.ent.cloudera.com:8080/286
Reviewed-by: Skye Wanderman-Milne <6d4b168ab637b0a20cc9dbf96abb2537f372f946@cloudera.com>
Tested-by: jenkins

theyaa/Impala,kapilrastogi/Impala,gerashegalov/Impala,XiaominZhang/Impala,henryr/Impala,lnliuxing/Impala,AtScaleInc/Impala,gerashegalov/Impala,rdblue/Impala,lirui-intel/Impala,AtScaleInc/Impala,ibmsoe/ImpalaPPC,andybab/Impala,cgvarela/Impala,cgvarela/Impala,scalingdata/Impala,caseyching/Impala,gerashegalov/Impala,bratatidas9/Impala-1,caseyching/Impala,rdblue/Impala,cgvarela/Impala,cchanning/Impala,tempbottle/Impala,cloudera/recordservice,ImpalaToGo/ImpalaToGo,ibmsoe/ImpalaPPC,scalingdata/Impala,placrosse/ImpalaToGo,andybab/Impala,cloudera/recordservice,bowlofstew/Impala,theyaa/Impala,lnliuxing/Impala,lirui-intel/Impala,lirui-intel/Impala,bowlofstew/Impala,lirui-intel/Impala,rampage644/impala-cut,brightchen/Impala,kapilrastogi/Impala,kapilrastogi/Impala,brightchen/Impala,gistic/PublicSpatialImpala,lnliuxing/Impala,scalingdata/Impala,mapr/impala,caseyching/Impala,theyaa/Impala,ibmsoe/ImpalaPPC,cgvarela/Impala,theyaa/Impala,ImpalaToGo/ImpalaToGo,rampage644/impala-cut,rampage644/impala-cut,kapilrastogi/Impala,scalingdata/Impala,cchanning/Impala,AtScaleInc/Impala,AtScaleInc/Impala,cchanning/Impala,rampage644/impala-cut,rdblue/Impala,ibmsoe/ImpalaPPC,gerashegalov/Impala,mapr/impala,tempbottle/Impala,placrosse/ImpalaToGo,rampage644/impala-cut,cgvarela/Impala,cgvarela/Impala,henryr/Impala,bowlofstew/Impala,brightchen/Impala,mapr/impala,gistic/PublicSpatialImpala,grundprinzip/Impala,theyaa/Impala,XiaominZhang/Impala,cchanning/Impala,ibmsoe/ImpalaPPC,gerashegalov/Impala,bratatidas9/Impala-1,cloudera/recordservice,andybab/Impala,henryr/Impala,bowlofstew/Impala,gistic/PublicSpatialImpala,henryr/Impala,tempbottle/Impala,ibmsoe/ImpalaPPC,tempbottle/Impala,andybab/Impala,bratatidas9/Impala-1,brightchen/Impala,ImpalaToGo/ImpalaToGo,XiaominZhang/Impala,bowlofstew/Impala,caseyching/Impala,henryr/Impala,XiaominZhang/Impala,cgvarela/Impala,XiaominZhang/Impala,mapr/impala,gerashegalov/Impala,grundprinzip/Impala,kapilrastogi/Impala,bratatidas9/Impala-1,caseyching/Impala,brightchen/Impala,cloudera/recordservice,cchanning/Impala,tempbottle/Impala,XiaominZhang/Impala,cloudera/recordservice,mapr/impala,AtScaleInc/Impala,rdblue/Impala,gerashegalov/Impala,tempbottle/Impala,lnliuxing/Impala,cchanning/Impala,grundprinzip/Impala,placrosse/ImpalaToGo,AtScaleInc/Impala,brightchen/Impala,bratatidas9/Impala-1,bowlofstew/Impala,lnliuxing/Impala,ImpalaToGo/ImpalaToGo,cloudera/recordservice,placrosse/ImpalaToGo,lnliuxing/Impala,caseyching/Impala,ImpalaToGo/ImpalaToGo,bowlofstew/Impala,brightchen/Impala,kapilrastogi/Impala,andybab/Impala,gistic/PublicSpatialImpala,andybab/Impala,tempbottle/Impala,gistic/PublicSpatialImpala,ImpalaToGo/ImpalaToGo,placrosse/ImpalaToGo,bratatidas9/Impala-1,caseyching/Impala,lirui-intel/Impala,grundprinzip/Impala,bratatidas9/Impala-1,theyaa/Impala,henryr/Impala,cchanning/Impala,cloudera/recordservice,rampage644/impala-cut,lnliuxing/Impala,grundprinzip/Impala,gistic/PublicSpatialImpala,rdblue/Impala,lirui-intel/Impala,placrosse/ImpalaToGo,theyaa/Impala,rdblue/Impala,kapilrastogi/Impala,XiaominZhang/Impala,scalingdata/Impala,rdblue/Impala,ibmsoe/ImpalaPPC,scalingdata/Impala,grundprinzip/Impala,lirui-intel/Impala