Repository navigation
fix(analytics): catch InfluxDBError in influx_query_manager (fixes #8510) - #8577
siddiqueirshad wants to merge 2 commits into
Conversation
|
@siddiqueirshad is attempting to deploy a commit to the Flagsmith Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to The query manager now captures InfluxDB HTTP-response errors and returns the existing empty-result fallback, so no material merge risk remains. ✨ Finishing Touches 💡 1
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 23414984-53c8-47ad-b70b-954fa7ff3e49
📒 Files selected for processing (2)
api/app_analytics/influxdb_wrapper.pyapi/tests/unit/app_analytics/test_unit_app_analytics_influxdb_wrapper.py
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.
|
Updated \InfluxDBWrapper.influx_query_manager\ to also catch \influxdb_client.rest.ApiException\ in addition to \HTTPError\ and \InfluxDBError\ so InfluxDB HTTP response errors (400, 401, 429, 5xx) don't escape unhandled. Added accompanying unit test covering \ApiException. |
Fixes #8510
Cause
influx_query_managercaught onlyurllib3.exceptions.HTTPError, which covers network/socket connection errors but not Influx HTTP error responses (influxdb_client.client.exceptions.InfluxDBError/ApiException). As a result, non-200 responses from InfluxDB propagated uncaught exceptions and resulted in 500 responses on caller endpoints.Solution
(HTTPError, InfluxDBError)ininflux_query_manager(matchingwrite()).influx_query_managerhandlesInfluxDBErrorby capturing the exception and returning an empty list.