@@ -699,20 +699,21 @@ def _poll_once(self, timer, max_records, update_offsets=True):
699
699
dict: Map of topic to list of records (may be empty).
700
700
"""
701
701
if not self ._coordinator .poll (timeout_ms = timer .timeout_ms ):
702
+ log .debug ('poll: timeout during coordinator.poll(); returning early' )
702
703
return {}
703
704
704
705
has_all_fetch_positions = self ._update_fetch_positions (timeout_ms = timer .timeout_ms )
705
706
706
707
# If data is available already, e.g. from a previous network client
707
708
# poll() call to commit, then just return it immediately
708
709
records , partial = self ._fetcher .fetched_records (max_records , update_offsets = update_offsets )
709
- log .debug ('Fetched records: %s, %s' , records , partial )
710
+ log .debug ('poll: fetched records: %s, %s' , records , partial )
710
711
# Before returning the fetched records, we can send off the
711
712
# next round of fetches and avoid block waiting for their
712
713
# responses to enable pipelining while the user is handling the
713
714
# fetched records.
714
715
if not partial :
715
- log .debug ("Sending fetches" )
716
+ log .debug ("poll: Sending fetches" )
716
717
futures = self ._fetcher .send_fetches ()
717
718
if len (futures ):
718
719
self ._client .poll (timeout_ms = 0 )
@@ -724,12 +725,14 @@ def _poll_once(self, timer, max_records, update_offsets=True):
724
725
# since the offset lookup may be backing off after a failure
725
726
poll_timeout_ms = min (timer .timeout_ms , self ._coordinator .time_to_next_poll () * 1000 )
726
727
if not has_all_fetch_positions :
728
+ log .debug ('poll: do not have all fetch positions...' )
727
729
poll_timeout_ms = min (poll_timeout_ms , self .config ['retry_backoff_ms' ])
728
730
729
731
self ._client .poll (timeout_ms = poll_timeout_ms )
730
732
# after the long poll, we should check whether the group needs to rebalance
731
733
# prior to returning data so that the group can stabilize faster
732
734
if self ._coordinator .need_rejoin ():
735
+ log .debug ('poll: coordinator needs rejoin; returning early' )
733
736
return {}
734
737
735
738
records , _ = self ._fetcher .fetched_records (max_records , update_offsets = update_offsets )
0 commit comments