@@ -699,20 +699,21 @@ def _poll_once(self, timer, max_records, update_offsets=True):
699699 dict: Map of topic to list of records (may be empty).
700700 """
701701 if not self ._coordinator .poll (timeout_ms = timer .timeout_ms ):
702+ log .debug ('poll: timeout during coordinator.poll(); returning early' )
702703 return {}
703704
704705 has_all_fetch_positions = self ._update_fetch_positions (timeout_ms = timer .timeout_ms )
705706
706707 # If data is available already, e.g. from a previous network client
707708 # poll() call to commit, then just return it immediately
708709 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 )
710711 # Before returning the fetched records, we can send off the
711712 # next round of fetches and avoid block waiting for their
712713 # responses to enable pipelining while the user is handling the
713714 # fetched records.
714715 if not partial :
715- log .debug ("Sending fetches" )
716+ log .debug ("poll: Sending fetches" )
716717 futures = self ._fetcher .send_fetches ()
717718 if len (futures ):
718719 self ._client .poll (timeout_ms = 0 )
@@ -724,12 +725,14 @@ def _poll_once(self, timer, max_records, update_offsets=True):
724725 # since the offset lookup may be backing off after a failure
725726 poll_timeout_ms = min (timer .timeout_ms , self ._coordinator .time_to_next_poll () * 1000 )
726727 if not has_all_fetch_positions :
728+ log .debug ('poll: do not have all fetch positions...' )
727729 poll_timeout_ms = min (poll_timeout_ms , self .config ['retry_backoff_ms' ])
728730
729731 self ._client .poll (timeout_ms = poll_timeout_ms )
730732 # after the long poll, we should check whether the group needs to rebalance
731733 # prior to returning data so that the group can stabilize faster
732734 if self ._coordinator .need_rejoin ():
735+ log .debug ('poll: coordinator needs rejoin; returning early' )
733736 return {}
734737
735738 records , _ = self ._fetcher .fetched_records (max_records , update_offsets = update_offsets )
0 commit comments