Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cache): Use the CacheSpecificError cache status #512

Merged
merged 15 commits into from
Aug 19, 2021

Conversation

relaxolotl
Copy link
Contributor

@relaxolotl relaxolotl commented Jul 30, 2021

Welcome to the final part of my 4-part series to make gooder symbolicator cache statuses. This has a slightly larger number of requested reviewers than my other 3 PRs since it actually turns the switch on to use the new cache status that's being introduced. If you're interested, feel free to visit the other 3 PRs listed below to get a bit of an idea of what the diffs of those look like.

We are now at step 5 of this list:

  1. Introduce the new cache status without changing the existing functionality, convert the new status to Malformed if needed (feat(cache): Add a new cache status CacheSpecificError #509)
  2. Update cache expiration strategy selection so different caches will expire entries triggered by cache-specific problems after a timeout that makes sense for the cache (CacheStatus::CacheSpecificError entries have different timeout behaviours based on the type of cache they belong to #516)
  3. Extend both the new cache status and the Malformed cache status to accept an arbitrary string that describes the root cause of the issue (feat(cache): Stuff error messages into Malformed and CacheSpecificError cache files #510)
  4. Identify and split out code paths that should be using the new cache status without changing their return value (feat(cache): Infrastructure to distinguish between errors caused by malformed objects vs cache-specific errors #511)
  5. 👉 Begin actually using the new cache status by returning it in places identified in the previous step and writing + reading those to and from the cache (feat(cache): Use the CacheSpecificError cache status #512) 👈 you are here

Changes

Unlike the other 3 PRs, this does make functional changes to symbolicator:

  • When a download failure occurs, return the appropriate errors from the downloaders
  • Handling the errors returned from the previous step and converting them into the correct cache status
  • Stop coercing cache-specific error cache entries into malformed entries, and begin writing them as their own type
  • Updating cache-specific error cache entries to use the same expiration strategy as negative cache entries This is no longer needed, already done in CacheStatus::CacheSpecificError entries have different timeout behaviours based on the type of cache they belong to #516 and the behaviour is locked behind the previous bullet point
  • Updating the cficache and symcache to handle cache-specific cache entries correctly
  • docs and notes

Notable new behaviour

  • Unlike Negative and Malformed, CacheSpecificError does not propagate from the data cache into the derived caches. It does propagate into the meta cache.

@relaxolotl relaxolotl changed the title feat(cache): Use the DownloadError cache status feat(cache): Use the CacheSpecificError cache status Aug 4, 2021
@relaxolotl
Copy link
Contributor Author

rebased this and updated the changes to reflect the change in definition to the new enum.

as mentioned in the description,CacheSpecificError entries do not propagate from the data cache into all other caches.

other changes in the diff:

  • i completely forgot about bitcode and updated its compute to cache download errors in the same way all of the other download caches do
  • added more tests to make sure that all cache types use the correct cache entry expiration strategy for the new cache type
  • updated tests + their docs
  • changed the structure of the match in from_derived_status to see if it helps make it harder to miss any edge cases

@untitaker untitaker removed their request for review August 5, 2021 10:14
Base automatically changed from feat/error-granularity to master August 17, 2021 08:52
@Swatinem
Copy link
Member

Same thing though as with the noperm changes: please test this manually to make sure sentry backend/ui can deal with these new candidate infos being returned.

@relaxolotl
Copy link
Contributor Author

relaxolotl commented Aug 19, 2021

for posterity: checked my build locally and cache specific errors show up like so

Screenshot 2021-08-19 at 8 47 30 AM

sentry is content with the payloads returned by symbolicator as a result of the changes made here

@relaxolotl relaxolotl merged commit e4041b4 into master Aug 19, 2021
@relaxolotl relaxolotl deleted the feat/all-the-things branch August 19, 2021 14:21
Swatinem added a commit that referenced this pull request Sep 8, 2021
#512 downgraded our log from error to debug, but that means we stopped reporting download errors to S4S.

This brings back S4S logging of download errors, but still skips unactionable permissions errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants