Gaurav598 opened a new issue, #40630:
URL: https://github.com/apache/beam/issues/40630

   ### What happened?
   
   On current master (1a3f1015445246911b4cd890e3686cc7ad2f2902), 
`retry_on_server_errors_timeout_or_quota_issues_filter` raises 
`JSONDecodeError` when an `apitools` HTTP 403 response body is not JSON. That 
replaces the original `HttpError` in decorated calls, including BigQuery paths 
that use this retry filter.
   
   Minimal reproduction with the Python SDK and its GCP dependencies:
   
   ```python
   from apitools.base.py.exceptions import HttpError
   from apache_beam.utils import retry
   
   error = HttpError({"status": "403"}, "<html>upstream error</html>", 
"https://example.invalid";)
   retry.retry_on_server_errors_timeout_or_quota_issues_filter(error)
   ```
   
   Actual: `JSONDecodeError: Expecting value: line 1 column 1 (char 0)`. 
Expected: `False`, so the retry decorator re-raises the original non-retryable 
`HttpError`. The 403 branch already treats missing or malformed structured 
reasons as non-retryable; its exception handler catches `KeyError`, 
`IndexError`, and `TypeError`, but misses `ValueError`/`JSONDecodeError` from 
`json.loads`.
   
   I reproduced this with `google-apitools` 0.5.35 and `google-api-core` 2.42.0 
on Python 3.14.3. No live GCP project or credentials were used. I plan to add a 
regression test and narrow fix.
   
   ### Issue Priority
   
   Priority: 2 (default / most bugs should be filed as P2)
   
   ### Issue Components
   
   - [x] Component: Python SDK
   - [ ] Component: Java SDK
   - [ ] Component: Go SDK
   - [ ] Component: Typescript SDK
   - [ ] Component: IO connector
   - [ ] Component: Beam YAML
   - [ ] Component: Beam examples
   - [ ] Component: Beam playground
   - [ ] Component: Beam katas
   - [ ] Component: Website
   - [ ] Component: Infrastructure
   - [ ] Component: Spark Runner
   - [ ] Component: Flink Runner
   - [ ] Component: Prism Runner
   - [ ] Component: Twister2 Runner
   - [ ] Component: Hazelcast Jet Runner
   - [ ] Component: Google Cloud Dataflow Runner


-- 
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