michaelpri10 commented on PR #67621:
URL: https://github.com/apache/airflow/pull/67621#issuecomment-4895915816

   I've updated the PR to change back to setting `return_immediately==True` by 
default with a deprecation notice per [this 
comment](https://github.com/apache/airflow/pull/67621/changes#r3447348740). I 
will note that `PubSubHook` currently [defaults to 
`return_immediately==False`](https://github.com/apache/airflow/blob/ff10b2e3e19c9a6c1a262ebd32ef65b968b39424/providers/google/src/airflow/providers/google/cloud/hooks/pubsub.py#L495),
 which has been in place since at least 
https://github.com/apache/airflow/pull/6096 (~7 years ago), so I've left that 
as is.
   
   With regards to the initial attempt to remove the `return_immediately` field 
in https://github.com/apache/airflow/pull/23231 and the subsequent issue in 
https://github.com/apache/airflow/issues/41838, the cause of that issue was 
because the field defaulted to `True`. This specific issue is noted in the 
[Cloud Pub/Sub 
documentation](https://docs.cloud.google.com/pubsub/docs/pull-troubleshooting#using_the_option_returnimmediately):
   
   > If your client is using unary Pull, check if the returnImmediately field 
is set to true. This is a deprecated field that tells the Pub/Sub service to 
respond to the pull request immediately even if it returns with no messages. 
This can result in pull requests returning with 0 messages even when there is a 
backlog.
   
   Thus, I think it would be beneficial to eventually switch the default to 
`False` (and remove the field completely later on).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to