@@ -176,7 +176,7 @@ impl<D: Data> ExchangeByDataPush<D> {
176
176
177
177
fn update_end (
178
178
& mut self , target : Option < usize > , end : & EndOfScope ,
179
- ) -> impl Iterator < Item = ( u64 , u64 , DynPeers ) > {
179
+ ) -> impl Iterator < Item = ( u64 , u64 , DynPeers ) > {
180
180
let mut push_stat = Vec :: with_capacity ( self . pushes . len ( ) ) ;
181
181
for ( index, p) in self . pushes . iter ( ) . enumerate ( ) {
182
182
let mut pushes = p. get_push_count ( & end. tag ) . unwrap_or ( 0 ) as u64 ;
@@ -245,7 +245,7 @@ impl<D: Data> ExchangeByDataPush<D> {
245
245
}
246
246
247
247
if has_block {
248
- if !batch. is_empty ( ) {
248
+ if !batch. is_empty ( ) || batch . is_last ( ) {
249
249
trace_worker ! (
250
250
"output[{:?}] blocking on push batch(len={}) of {:?} ;" ,
251
251
self . port,
@@ -534,9 +534,10 @@ impl<D: Data> BlockPush for ExchangeByDataPush<D> {
534
534
. blocks
535
535
. get_mut ( tag)
536
536
. expect ( "expect has block;" ) ;
537
- while let Some ( x) = blocks . pop_front ( ) {
538
- b . push_back ( x) ;
537
+ while let Some ( x) = b . pop_back ( ) {
538
+ blocks . push_front ( x) ;
539
539
}
540
+ * b = blocks;
540
541
}
541
542
Ok ( false )
542
543
} else {
@@ -590,7 +591,7 @@ impl<D: Data> ExchangeByBatchPush<D> {
590
591
591
592
fn update_end (
592
593
& mut self , target : Option < usize > , end : & EndOfScope ,
593
- ) -> impl Iterator < Item = ( u64 , u64 , DynPeers ) > {
594
+ ) -> impl Iterator < Item = ( u64 , u64 , DynPeers ) > {
594
595
let mut push_stat = Vec :: with_capacity ( self . pushes . len ( ) ) ;
595
596
for ( index, p) in self . pushes . iter ( ) . enumerate ( ) {
596
597
let mut pushes = p. get_push_count ( & end. tag ) . unwrap_or ( 0 ) as u64 ;
0 commit comments