@@ -909,28 +909,28 @@ def _handle_heartbeat_response(self, future, send_time, response):
909909 error_type = Errors .for_code (response .error_code )
910910 if error_type is Errors .NoError :
911911 heartbeat_log .debug ("Received successful heartbeat response for group %s" ,
912- self .group_id )
912+ self .group_id )
913913 future .success (None )
914914 elif error_type in (Errors .CoordinatorNotAvailableError ,
915915 Errors .NotCoordinatorError ):
916916 heartbeat_log .warning ("Heartbeat failed for group %s: coordinator (node %s)"
917- " is either not started or not valid" , self .group_id ,
917+ " is either not started or not valid" , self .group_id ,
918918 self .coordinator ())
919919 self .coordinator_dead (error_type ())
920920 future .failure (error_type ())
921921 elif error_type is Errors .RebalanceInProgressError :
922922 heartbeat_log .warning ("Heartbeat failed for group %s because it is"
923- " rebalancing" , self .group_id )
923+ " rebalancing" , self .group_id )
924924 self .request_rejoin ()
925925 future .failure (error_type ())
926926 elif error_type is Errors .IllegalGenerationError :
927927 heartbeat_log .warning ("Heartbeat failed for group %s: generation id is not "
928- " current." , self .group_id )
928+ " current." , self .group_id )
929929 self .reset_generation ()
930930 future .failure (error_type ())
931931 elif error_type is Errors .UnknownMemberIdError :
932932 heartbeat_log .warning ("Heartbeat: local member_id was not recognized;"
933- " this consumer needs to re-join" )
933+ " this consumer needs to re-join" )
934934 self .reset_generation ()
935935 future .failure (error_type )
936936 elif error_type is Errors .GroupAuthorizationFailedError :
@@ -1038,16 +1038,16 @@ def close(self, timeout_ms=None):
10381038
10391039 def run (self ):
10401040 try :
1041- heartbeat_log .debug ('Heartbeat thread started' )
1041+ heartbeat_log .debug ('Heartbeat thread started: %s' , self . coordinator . heartbeat )
10421042 while not self .closed :
10431043 self ._run_once ()
10441044
10451045 except ReferenceError :
10461046 heartbeat_log .debug ('Heartbeat thread closed due to coordinator gc' )
10471047
1048- except RuntimeError as e :
1049- heartbeat_log .error ("Heartbeat thread for group %s failed due to unexpected error: %s" ,
1050- self .coordinator .group_id , e )
1048+ except Exception as e :
1049+ heartbeat_log .exception ("Heartbeat thread for group %s failed due to unexpected error: %s" ,
1050+ self .coordinator .group_id , e )
10511051 self .failed = e
10521052
10531053 finally :
0 commit comments