You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "TanuSharma2511 (via GitHub)" <gi...@apache.org> on 2025/06/19 09:34:57 UTC

[PR] Distinguishing bigquery logging failures severities [beam]

TanuSharma2511 opened a new pull request, #35373:
URL: https://github.com/apache/beam/pull/35373

   It resolves #35356 
   
   ------------------------
   
   Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [ ] Mention the appropriate issue in your description (for example: `addresses #123`), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
    - [ ] Update `CHANGES.md` with noteworthy changes.
    - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://github.com/apache/beam/blob/master/CONTRIBUTING.md#make-the-reviewers-job-easier).
   
   To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
   
   GitHub Actions Tests Status (on master branch)
   ------------------------------------------------------------------------------------------------
   [![Build python source distribution and wheels](https://github.com/apache/beam/actions/workflows/build_wheels.yml/badge.svg?event=schedule&&?branch=master)](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
   [![Python tests](https://github.com/apache/beam/actions/workflows/python_tests.yml/badge.svg?event=schedule&&?branch=master)](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Java tests](https://github.com/apache/beam/actions/workflows/java_tests.yml/badge.svg?event=schedule&&?branch=master)](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Go tests](https://github.com/apache/beam/actions/workflows/go_tests.yml/badge.svg?event=schedule&&?branch=master)](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
   
   See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI or the [workflows README](https://github.com/apache/beam/blob/master/.github/workflows/README.md) to see a list of phrases to trigger workflows.
   


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on PR #35373:
URL: https://github.com/apache/beam/pull/35373#issuecomment-3071605810

   However, when looking closely to the comment above the code:
   ```
           # The log level is:
           # - WARNING when we are continuing to retry, and have a deadline.
           # - ERROR when we will no longer retry, or MAY retry forever.
   ```
   
   It seems there is something we can improve here. I would recommend we do the following changes.
   <table class="tg"><thead>
     <tr>
       <th class="tg-0lax">retry_backoff</th>
       <th class="tg-0lax">retry_strategy + message</th>
       <th class="tg-0lax">should_retry</th>
       <th class="tg-0lax">log level</th>
     </tr></thead>
   <tbody>
     <tr>
       <td class="tg-0lax" rowspan="4">not None</td>
       <td class="tg-0lax">RETRY_ALWAYS + any </td>
       <td class="tg-0lax">true</td>
       <td class="tg-0lax">WARN</td>
     </tr>
     <tr>
       <td class="tg-0lax"><span style="font-weight:400;font-style:normal">RETRY_ON_TRANSIENT_ERROR + </span><br><span style="font-weight:400;font-style:normal">transient error</span></td>
       <td class="tg-0lax">true</td>
       <td class="tg-0lax">WARN</td>
     </tr>
     <tr>
       <td class="tg-0lax"><span style="font-weight:400;font-style:normal">RETRY_ON_TRANSIENT_ERROR + </span><br><span style="font-weight:400;font-style:normal">non-transient error</span></td>
       <td class="tg-0lax">false</td>
       <td class="tg-0lax"><s>WARN</s> ERROR</td>
     </tr>
     <tr>
       <td class="tg-0lax">RETRY_NEVER + any</td>
       <td class="tg-0lax">false</td>
       <td class="tg-0lax"><s>WARN</s> ERROR</td>
     </tr>
     <tr>
       <td class="tg-0lax" rowspan="4">None</td>
       <td class="tg-0lax">RETRY_ALWAYS + any</td>
       <td class="tg-0lax">false</td>
       <td class="tg-0lax">ERROR</td>
     </tr>
     <tr>
       <td class="tg-0lax"><span style="font-weight:400;font-style:normal">RETRY_ON_TRANSIENT_ERROR + </span><br><span style="font-weight:400;font-style:normal">transient error</span></td>
       <td class="tg-0lax">false</td>
       <td class="tg-0lax"><s>WARN</s> ERROR</td>
     </tr>
     <tr>
       <td class="tg-0lax"><span style="font-weight:400;font-style:normal">RETRY_ON_TRANSIENT_ERROR + </span><br><span style="font-weight:400;font-style:normal">non-transient error</span></td>
       <td class="tg-0lax">false</td>
       <td class="tg-0lax"><s>WARN</s> ERROR</td>
     </tr>
     <tr>
       <td class="tg-0lax">RETRY_NEVER + any</td>
       <td class="tg-0lax">false</td>
       <td class="tg-0lax"><s>WARN</s> ERROR</td>
     </tr>
   </tbody></table>
   


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on code in PR #35373:
URL: https://github.com/apache/beam/pull/35373#discussion_r2208283125


##########
sdks/python/apache_beam/io/gcp/bigquery.py:
##########
@@ -1712,9 +1712,15 @@ def _flush_batch(self, destination):
         # The log level is:
         # - WARNING when we are continuing to retry, and have a deadline.
         # - ERROR when we will no longer retry, or MAY retry forever.
-        log_level = (
-            logging.WARN if should_retry or self._retry_strategy
-            != RetryStrategy.RETRY_ALWAYS else logging.ERROR)
+        if (self._retry_strategy == RetryStrategy.RETRY_ON_TRANSIENT_ERROR and
+            not should_retry):
+          log_level = logging.ERROR
+        elif self._retry_strategy == RetryStrategy.RETRY_NEVER:
+          log_level = logging.ERROR
+        elif should_retry or self._retry_strategy != RetryStrategy.RETRY_ALWAYS:

Review Comment:
   This condition is not accurate: 
   ```python
   elif should_retry or self._retry_strategy != RetryStrategy.RETRY_ALWAYS:
     log_level = logging.WARN
   ```
   
   Using the table in https://github.com/apache/beam/pull/35373#issuecomment-3071605810, we can see if 
   (1) `retry_strategy == RetryStrategy.RETRY_ON_TRANSIENT_ERROR`, 
   (2) the error is a transient error, and 
   (3) `retry_backoff == None`, 
   
   then `should_retry` is false and the code will give out a WARNING message.
   
   The scenario here is that there is a transient error and we exhaust all the retries. I think we should give a error message at last. Right?
   
   



##########
sdks/python/apache_beam/io/gcp/bigquery.py:
##########
@@ -1712,9 +1712,15 @@ def _flush_batch(self, destination):
         # The log level is:
         # - WARNING when we are continuing to retry, and have a deadline.
         # - ERROR when we will no longer retry, or MAY retry forever.
-        log_level = (
-            logging.WARN if should_retry or self._retry_strategy
-            != RetryStrategy.RETRY_ALWAYS else logging.ERROR)
+        if (self._retry_strategy == RetryStrategy.RETRY_ON_TRANSIENT_ERROR and
+            not should_retry):
+          log_level = logging.ERROR
+        elif self._retry_strategy == RetryStrategy.RETRY_NEVER:
+          log_level = logging.ERROR
+        elif should_retry or self._retry_strategy != RetryStrategy.RETRY_ALWAYS:

Review Comment:
   This condition is not accurate: 
   ```python
   elif should_retry or self._retry_strategy != RetryStrategy.RETRY_ALWAYS:
     log_level = logging.WARN
   ```
   
   Using the table in https://github.com/apache/beam/pull/35373#issuecomment-3071605810, we can see if 
   (1) `retry_strategy == RetryStrategy.RETRY_ON_TRANSIENT_ERROR`, 
   (2) the error is a transient error, and 
   (3) `retry_backoff == None`, 
   
   then `should_retry` is false and the code will give out a WARNING message.
   
   The scenario here is that there is a transient error and we exhaust all the retries. I think we should give an error message at last. Right?
   
   



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #35373:
URL: https://github.com/apache/beam/pull/35373#issuecomment-2987677038

   Assigning reviewers:
   
   R: @shunping for label python.
   
   
   Note: If you would like to opt out of this review, comment `assign to next reviewer`.
   
   Available commands:
   - `stop reviewer notifications` - opt out of the automated review tooling
   - `remind me after tests pass` - tag the comment author after tests pass
   - `waiting on author` - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)
   
   The PR bot will only process comments in the main thread (not review comments).


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #35373:
URL: https://github.com/apache/beam/pull/35373#issuecomment-3027653181

   Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment `assign to next reviewer`:
   
   R: @liferoad for label python.
   
   Available commands:
   - `stop reviewer notifications` - opt out of the automated review tooling
   - `remind me after tests pass` - tag the comment author after tests pass
   - `waiting on author` - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "TanuSharma2511 (via GitHub)" <gi...@apache.org>.
TanuSharma2511 commented on PR #35373:
URL: https://github.com/apache/beam/pull/35373#issuecomment-3100077575

   Run Portable_Python PreCommit 3.9


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "TanuSharma2511 (via GitHub)" <gi...@apache.org>.
TanuSharma2511 commented on PR #35373:
URL: https://github.com/apache/beam/pull/35373#issuecomment-3071995765

   In my opinion, for retry_strategy=RETRY_NEVER, there will be only one condition i.e. 
   RETRY_NEVER + any with should_retry= false, so there is no harm in logging ERROR here. This means whatever error we are not retrying, it is worth highlighting that message as ERROR once.
   
    @claudevdm can give the final lgtm.


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "TanuSharma2511 (via GitHub)" <gi...@apache.org>.
TanuSharma2511 commented on PR #35373:
URL: https://github.com/apache/beam/pull/35373#issuecomment-3095301820

   Run Python PreCommit 3.9


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on PR #35373:
URL: https://github.com/apache/beam/pull/35373#issuecomment-3076389752

   waiting on author


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "TanuSharma2511 (via GitHub)" <gi...@apache.org>.
TanuSharma2511 commented on code in PR #35373:
URL: https://github.com/apache/beam/pull/35373#discussion_r2182238226


##########
sdks/python/apache_beam/io/gcp/bigquery.py:
##########
@@ -1712,9 +1712,15 @@ def _flush_batch(self, destination):
         # The log level is:
         # - WARNING when we are continuing to retry, and have a deadline.
         # - ERROR when we will no longer retry, or MAY retry forever.
-        log_level = (
-            logging.WARN if should_retry or self._retry_strategy
-            != RetryStrategy.RETRY_ALWAYS else logging.ERROR)
+        if (self._retry_strategy == RetryStrategy.RETRY_ON_TRANSIENT_ERROR and
+            not should_retry):
+          log_level = logging.ERROR
+        elif self._retry_strategy == RetryStrategy.RETRY_NEVER:
+          log_level = logging.ERROR
+        elif should_retry or self._retry_strategy != RetryStrategy.RETRY_ALWAYS:

Review Comment:
   @claudevdm Can you please check my comment ?



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on code in PR #35373:
URL: https://github.com/apache/beam/pull/35373#discussion_r2208283125


##########
sdks/python/apache_beam/io/gcp/bigquery.py:
##########
@@ -1712,9 +1712,15 @@ def _flush_batch(self, destination):
         # The log level is:
         # - WARNING when we are continuing to retry, and have a deadline.
         # - ERROR when we will no longer retry, or MAY retry forever.
-        log_level = (
-            logging.WARN if should_retry or self._retry_strategy
-            != RetryStrategy.RETRY_ALWAYS else logging.ERROR)
+        if (self._retry_strategy == RetryStrategy.RETRY_ON_TRANSIENT_ERROR and
+            not should_retry):
+          log_level = logging.ERROR
+        elif self._retry_strategy == RetryStrategy.RETRY_NEVER:
+          log_level = logging.ERROR
+        elif should_retry or self._retry_strategy != RetryStrategy.RETRY_ALWAYS:

Review Comment:
   This condition is not accurate: 
   ```python
   elif should_retry or self._retry_strategy != RetryStrategy.RETRY_ALWAYS:
     log_level = logging.WARN
   ```
   
   Using the table in https://github.com/apache/beam/pull/35373#issuecomment-3071605810, we can see if 
   (1) `retry_strategy == RetryStrategy.RETRY_ON_TRANSIENT_ERROR`, 
   (2) the error is a transient error, and 
   (3) `retry_backoff == None`, 
   
   then `should_retry` is false and the code will give out a WARNING message.
   
   The scenario here is that there is a transient error and we exhaust all the retrying. I think we should give a error message at last. Right?
   
   



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "claudevdm (via GitHub)" <gi...@apache.org>.
claudevdm commented on code in PR #35373:
URL: https://github.com/apache/beam/pull/35373#discussion_r2205251386


##########
sdks/python/apache_beam/io/gcp/bigquery.py:
##########
@@ -1712,9 +1712,15 @@ def _flush_batch(self, destination):
         # The log level is:
         # - WARNING when we are continuing to retry, and have a deadline.
         # - ERROR when we will no longer retry, or MAY retry forever.
-        log_level = (
-            logging.WARN if should_retry or self._retry_strategy
-            != RetryStrategy.RETRY_ALWAYS else logging.ERROR)
+        if (self._retry_strategy == RetryStrategy.RETRY_ON_TRANSIENT_ERROR and
+            not should_retry):
+          log_level = logging.ERROR
+        elif self._retry_strategy == RetryStrategy.RETRY_NEVER:
+          log_level = logging.ERROR
+        elif should_retry or self._retry_strategy != RetryStrategy.RETRY_ALWAYS:

Review Comment:
   So should it be `elif should_retry AND self._retry_strategy != RetryStrategy.RETRY_ALWAYS`?



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on code in PR #35373:
URL: https://github.com/apache/beam/pull/35373#discussion_r2208283125


##########
sdks/python/apache_beam/io/gcp/bigquery.py:
##########
@@ -1712,9 +1712,15 @@ def _flush_batch(self, destination):
         # The log level is:
         # - WARNING when we are continuing to retry, and have a deadline.
         # - ERROR when we will no longer retry, or MAY retry forever.
-        log_level = (
-            logging.WARN if should_retry or self._retry_strategy
-            != RetryStrategy.RETRY_ALWAYS else logging.ERROR)
+        if (self._retry_strategy == RetryStrategy.RETRY_ON_TRANSIENT_ERROR and
+            not should_retry):
+          log_level = logging.ERROR
+        elif self._retry_strategy == RetryStrategy.RETRY_NEVER:
+          log_level = logging.ERROR
+        elif should_retry or self._retry_strategy != RetryStrategy.RETRY_ALWAYS:

Review Comment:
   This condition is not accurate: 
   ```python
   elif should_retry or self._retry_strategy != RetryStrategy.RETRY_ALWAYS:
     log_level = logging.WARN
   ```
   
   Using the table in https://github.com/apache/beam/pull/35373#issuecomment-3071605810, we can see if 
   (1) `retry_strategy == RetryStrategy.RETRY_ON_TRANSIENT_ERROR`, 
   (2) the error is a transient error, and 
   (3) `retry_backoff == None`, 
   
   then `should_retry` is false and your current implementation will give a WARNING message.
   
   The scenario here is that there is a transient error and we exhaust all the retries. I think we should give an error message at last. Right?
   
   



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on PR #35373:
URL: https://github.com/apache/beam/pull/35373#issuecomment-3074702217

   > In my opinion, for retry_strategy=RETRY_NEVER, there will be only one condition i.e. RETRY_NEVER + any with should_retry= false, so there is no harm in logging ERROR here. This means whatever error we are not retrying, it is worth highlighting that message as ERROR once.
   > 
   > @claudevdm can give the final lgtm.
   
   I think your current implementation mostly agrees with the table at https://github.com/apache/beam/pull/35373#issuecomment-3071605810.
   
   In that case, why don't we simplify the following condition?
   ```
   if (should_retry and self._retry_strategy in [RetryStrategy.RETRY_ON_TRANSIENT_ERROR, RetryStrategy.RETRY_ALL):
     log_level = logging.WARN
   else:
     log_level = logging.ERROR
   ```


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on PR #35373:
URL: https://github.com/apache/beam/pull/35373#issuecomment-3071589488

   Let's break down the situation with the help of the following table.
   
   The logging level prior to this PR is:
   <table class="tg"><thead>
     <tr>
       <th class="tg-0lax">retry_backoff</th>
       <th class="tg-0lax">retry_strategy + message</th>
       <th class="tg-0lax">should_retry</th>
       <th class="tg-0lax">log level</th>
     </tr></thead>
   <tbody>
     <tr>
       <td class="tg-0lax" rowspan="4">not None</td>
       <td class="tg-0lax">RETRY_ALWAYS</td>
       <td class="tg-0lax">true</td>
       <td class="tg-0lax">WARN</td>
     </tr>
     <tr>
       <td class="tg-0lax"><span style="font-weight:400;font-style:normal">RETRY_ON_TRANSIENT_ERROR</span><br><span style="font-weight:400;font-style:normal">transient error</span></td>
       <td class="tg-0lax">true</td>
       <td class="tg-0lax">WARN</td>
     </tr>
     <tr>
       <td class="tg-0lax"><span style="font-weight:400;font-style:normal">RETRY_ON_TRANSIENT_ERROR</span><br><span style="font-weight:400;font-style:normal">non-transient error</span></td>
       <td class="tg-0lax">false</td>
       <td class="tg-0lax">WARN</td>
     </tr>
     <tr>
       <td class="tg-0lax">RETRY_NEVER</td>
       <td class="tg-0lax">false</td>
       <td class="tg-0lax">WARN</td>
     </tr>
     <tr>
       <td class="tg-0lax" rowspan="4">None</td>
       <td class="tg-0lax">RETRY_ALWAYS</td>
       <td class="tg-0lax">false</td>
       <td class="tg-0lax">ERROR</td>
     </tr>
     <tr>
       <td class="tg-0lax"><span style="font-weight:400;font-style:normal">RETRY_ON_TRANSIENT_ERROR</span><br><span style="font-weight:400;font-style:normal">transient error</span></td>
       <td class="tg-0lax">false</td>
       <td class="tg-0lax">WARN</td>
     </tr>
     <tr>
       <td class="tg-0lax"><span style="font-weight:400;font-style:normal">RETRY_ON_TRANSIENT_ERROR</span><br><span style="font-weight:400;font-style:normal">non-transient error</span></td>
       <td class="tg-0lax">false</td>
       <td class="tg-0lax">WARN</td>
     </tr>
     <tr>
       <td class="tg-0lax">RETRY_NEVER</td>
       <td class="tg-0lax">false</td>
       <td class="tg-0lax">WARN</td>
     </tr>
   </tbody></table>
   
   The problem pointing out from the issue is that, the user expect that when `RETRY_ON_TRANSIENT_ERROR` is in use and non-transient errors occur, we should issue a error level logging messages.
   
   


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping merged PR #35373:
URL: https://github.com/apache/beam/pull/35373


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "TanuSharma2511 (via GitHub)" <gi...@apache.org>.
TanuSharma2511 commented on PR #35373:
URL: https://github.com/apache/beam/pull/35373#issuecomment-2988058280

   Run Python_ML PreCommit 3.9


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "TanuSharma2511 (via GitHub)" <gi...@apache.org>.
TanuSharma2511 commented on code in PR #35373:
URL: https://github.com/apache/beam/pull/35373#discussion_r2182237254


##########
sdks/python/apache_beam/io/gcp/bigquery.py:
##########
@@ -1712,9 +1712,15 @@ def _flush_batch(self, destination):
         # The log level is:
         # - WARNING when we are continuing to retry, and have a deadline.
         # - ERROR when we will no longer retry, or MAY retry forever.
-        log_level = (
-            logging.WARN if should_retry or self._retry_strategy
-            != RetryStrategy.RETRY_ALWAYS else logging.ERROR)
+        if (self._retry_strategy == RetryStrategy.RETRY_ON_TRANSIENT_ERROR and
+            not should_retry):
+          log_level = logging.ERROR
+        elif self._retry_strategy == RetryStrategy.RETRY_NEVER:
+          log_level = logging.ERROR
+        elif should_retry or self._retry_strategy != RetryStrategy.RETRY_ALWAYS:

Review Comment:
   Warning will show for RETRY_ON_TRANSIENT_ERROR(with should retry) and for should_retry errors but as per the original comments: # - WARNING when we are continuing to retry, and have a deadline.
           # - ERROR when we will no longer retry, or MAY retry forever.
   
   RETRY_ALWAYS comes in retry forever category, thats why Retry_ALWAYS is classified as error logs. Please let me know if there are any changes needed.



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #35373:
URL: https://github.com/apache/beam/pull/35373#issuecomment-3057204136

   Reminder, please take a look at this pr: @liferoad 


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on code in PR #35373:
URL: https://github.com/apache/beam/pull/35373#discussion_r2208283125


##########
sdks/python/apache_beam/io/gcp/bigquery.py:
##########
@@ -1712,9 +1712,15 @@ def _flush_batch(self, destination):
         # The log level is:
         # - WARNING when we are continuing to retry, and have a deadline.
         # - ERROR when we will no longer retry, or MAY retry forever.
-        log_level = (
-            logging.WARN if should_retry or self._retry_strategy
-            != RetryStrategy.RETRY_ALWAYS else logging.ERROR)
+        if (self._retry_strategy == RetryStrategy.RETRY_ON_TRANSIENT_ERROR and
+            not should_retry):
+          log_level = logging.ERROR
+        elif self._retry_strategy == RetryStrategy.RETRY_NEVER:
+          log_level = logging.ERROR
+        elif should_retry or self._retry_strategy != RetryStrategy.RETRY_ALWAYS:

Review Comment:
   This condition is not accurate: 
   ```
   elif should_retry or self._retry_strategy != RetryStrategy.RETRY_ALWAYS:
     log_level = logging.WARN
   ```
   
   Using the table in https://github.com/apache/beam/pull/35373#issuecomment-3071605810, we can see if 
   (1) `retry_strategy == RetryStrategy.RETRY_ON_TRANSIENT_ERROR`, 
   (2) the error is a transient error, and 
   (3) `retry_backoff == None`, 
   
   then `should_retry` is false and the code will give out a WARNING message.
   
   The scenario here is there is a transient error and we exhaust all the retrying. I think we should give a error message at last. Right?
   
   



##########
sdks/python/apache_beam/io/gcp/bigquery.py:
##########
@@ -1712,9 +1712,15 @@ def _flush_batch(self, destination):
         # The log level is:
         # - WARNING when we are continuing to retry, and have a deadline.
         # - ERROR when we will no longer retry, or MAY retry forever.
-        log_level = (
-            logging.WARN if should_retry or self._retry_strategy
-            != RetryStrategy.RETRY_ALWAYS else logging.ERROR)
+        if (self._retry_strategy == RetryStrategy.RETRY_ON_TRANSIENT_ERROR and
+            not should_retry):
+          log_level = logging.ERROR
+        elif self._retry_strategy == RetryStrategy.RETRY_NEVER:
+          log_level = logging.ERROR
+        elif should_retry or self._retry_strategy != RetryStrategy.RETRY_ALWAYS:

Review Comment:
   This condition is not accurate: 
   ```python
   elif should_retry or self._retry_strategy != RetryStrategy.RETRY_ALWAYS:
     log_level = logging.WARN
   ```
   
   Using the table in https://github.com/apache/beam/pull/35373#issuecomment-3071605810, we can see if 
   (1) `retry_strategy == RetryStrategy.RETRY_ON_TRANSIENT_ERROR`, 
   (2) the error is a transient error, and 
   (3) `retry_backoff == None`, 
   
   then `should_retry` is false and the code will give out a WARNING message.
   
   The scenario here is there is a transient error and we exhaust all the retrying. I think we should give a error message at last. Right?
   
   



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #35373:
URL: https://github.com/apache/beam/pull/35373#issuecomment-3069269231

   Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment `assign to next reviewer`:
   
   R: @jrmccluskey for label python.
   
   Available commands:
   - `stop reviewer notifications` - opt out of the automated review tooling
   - `remind me after tests pass` - tag the comment author after tests pass
   - `waiting on author` - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Distinguishing bigquery logging failures severities [beam]

Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on PR #35373:
URL: https://github.com/apache/beam/pull/35373#issuecomment-3071614723

   WDYT? @claudevdm @TanuSharma2511 


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org