@@ -909,28 +909,28 @@ def _handle_heartbeat_response(self, future, send_time, response):
909
909
error_type = Errors .for_code (response .error_code )
910
910
if error_type is Errors .NoError :
911
911
heartbeat_log .debug ("Received successful heartbeat response for group %s" ,
912
- self .group_id )
912
+ self .group_id )
913
913
future .success (None )
914
914
elif error_type in (Errors .CoordinatorNotAvailableError ,
915
915
Errors .NotCoordinatorError ):
916
916
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 ,
918
918
self .coordinator ())
919
919
self .coordinator_dead (error_type ())
920
920
future .failure (error_type ())
921
921
elif error_type is Errors .RebalanceInProgressError :
922
922
heartbeat_log .warning ("Heartbeat failed for group %s because it is"
923
- " rebalancing" , self .group_id )
923
+ " rebalancing" , self .group_id )
924
924
self .request_rejoin ()
925
925
future .failure (error_type ())
926
926
elif error_type is Errors .IllegalGenerationError :
927
927
heartbeat_log .warning ("Heartbeat failed for group %s: generation id is not "
928
- " current." , self .group_id )
928
+ " current." , self .group_id )
929
929
self .reset_generation ()
930
930
future .failure (error_type ())
931
931
elif error_type is Errors .UnknownMemberIdError :
932
932
heartbeat_log .warning ("Heartbeat: local member_id was not recognized;"
933
- " this consumer needs to re-join" )
933
+ " this consumer needs to re-join" )
934
934
self .reset_generation ()
935
935
future .failure (error_type )
936
936
elif error_type is Errors .GroupAuthorizationFailedError :
@@ -1038,16 +1038,16 @@ def close(self, timeout_ms=None):
1038
1038
1039
1039
def run (self ):
1040
1040
try :
1041
- heartbeat_log .debug ('Heartbeat thread started' )
1041
+ heartbeat_log .debug ('Heartbeat thread started: %s' , self . coordinator . heartbeat )
1042
1042
while not self .closed :
1043
1043
self ._run_once ()
1044
1044
1045
1045
except ReferenceError :
1046
1046
heartbeat_log .debug ('Heartbeat thread closed due to coordinator gc' )
1047
1047
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 )
1051
1051
self .failed = e
1052
1052
1053
1053
finally :
0 commit comments