@@ -369,13 +369,11 @@ impl Session {
369
369
fn read_connection ( & mut self , conn : & mut Connection , buf : & mut Vec < u8 > ) -> Result < ( ) , Error > {
370
370
match conn. read_buf ( buf) {
371
371
Ok ( 0 ) => {
372
- log:: debug!( "ZooKeeper session {} encounters server closed" , self . session_id) ;
373
372
return Err ( Error :: ConnectionLoss ) ;
374
373
} ,
375
374
Err ( err) => {
376
375
if err. kind ( ) != io:: ErrorKind :: WouldBlock {
377
- log:: debug!( "ZooKeeper session {} encounters read err {}" , self . session_id, err) ;
378
- return Err ( Error :: ConnectionLoss ) ;
376
+ return Err ( Error :: other_from ( err) ) ;
379
377
}
380
378
} ,
381
379
_ => { } ,
@@ -418,7 +416,7 @@ impl Session {
418
416
self . handle_recv_buf( buf, depot) ?;
419
417
} ,
420
418
_ = conn. writable( ) , if depot. has_pending_writes( ) || conn. wants_write( ) => {
421
- depot. write_operations( conn, self . session_id ) ?;
419
+ depot. write_operations( conn) ?;
422
420
self . last_send = Instant :: now( ) ;
423
421
} ,
424
422
now = tick. tick( ) => {
@@ -450,7 +448,7 @@ impl Session {
450
448
self . handle_recv_buf( buf, depot) ?;
451
449
} ,
452
450
_ = conn. writable( ) , if depot. has_pending_writes( ) || conn. wants_write( ) => {
453
- depot. write_operations( conn, self . session_id ) ?;
451
+ depot. write_operations( conn) ?;
454
452
self . last_send = Instant :: now( ) ;
455
453
} ,
456
454
r = requester. recv( ) , if !channel_closed => {
@@ -464,7 +462,7 @@ impl Session {
464
462
continue ;
465
463
} ;
466
464
depot. push_session( operation) ;
467
- depot. write_operations( conn, self . session_id ) ?;
465
+ depot. write_operations( conn) ?;
468
466
self . last_send = Instant :: now( ) ;
469
467
} ,
470
468
r = unwatch_requester. recv( ) => if let Some ( ( watcher_id, responser) ) = r {
@@ -476,7 +474,7 @@ impl Session {
476
474
}
477
475
if self . last_ping. is_none( ) && now >= self . last_send + self . ping_timeout {
478
476
self . send_ping( depot, now) ;
479
- depot. write_operations( conn, self . session_id ) ?;
477
+ depot. write_operations( conn) ?;
480
478
}
481
479
} ,
482
480
}
0 commit comments