grafana-toolbox / grafana-wtf

Grep through all Grafana entities in the spirit of git-wtf.
GNU Affero General Public License v3.0
159 stars 16 forks source link

SQLite cache: Use `requests_cache.CachedSession` for better concurrency #130

Closed amotl closed 8 months ago

amotl commented 8 months ago

About

Details

Users on Apple M2 Max reported DB lock errors:

[grafana_wtf.core]
  INFO: Fetching dashboards in parallel with 5 concurrent requests

[requests_cache.backends.sqlite]
  WARNING: Database is locked in thread 6272069632; retrying (1/3)

Also segmentation faults, and leaks:

  UserWarning: resource_tracker: There appear to be 1 leaked semaphore
  objects to clean up at shutdown

NB: @Ousret, @JWCook: Just in case you didn't know yet -- Apparently, using Niquests together with Requests-Cache works well, at least according to the succeeding test suite.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 86.68%. Comparing base (76e1abd) to head (5583ae0).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #130 +/- ## ========================================== + Coverage 86.50% 86.68% +0.17% ========================================== Files 8 9 +1 Lines 1060 1074 +14 ========================================== + Hits 917 931 +14 Misses 143 143 ``` | [Flag](https://app.codecov.io/gh/panodata/grafana-wtf/pull/130/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=panodata) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/panodata/grafana-wtf/pull/130/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=panodata) | `86.68% <100.00%> (+0.17%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=panodata#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.