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): Stuff error messages into Malformed and CacheSpecificError cache files #510

Merged
merged 3 commits into from
Aug 5, 2021

Conversation

relaxolotl
Copy link
Contributor

@relaxolotl relaxolotl commented Jul 30, 2021

Welcome to part 2 of my PR series on making symbolicator's cache statuses gooder. Before reviewing or merging this PR, you may be interested in taking a look at part 1 first for some context: #509

If you've already seen #509 or you're brave enough to be look at these changes as-is because you reviewed an eerily similar set of changes in a previous PR, then let's continue.

This belongs to the following chain of PRs:

  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) 👈 you are here
  4. Identify and split out code paths that should be using the new cache status without changing their return value
  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

This PR does one thing: it stuffs an error string returned by the Display impl of the error into Malformed and CacheSpecificError entries, and adds all of the plumbing needed to write and read them from their respective cache files. This makes no functional changes to symbolicator.

log::warn!("Error while parsing cficache: {}", LogError(&err));
log::warn!(
"Error while parsing cficache: {} ({})",
LogError(&err),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn’t LogError already contain the details?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately not: LogError in this case just spits out an in-depth string for CfiCacheError::ObjectParsing(ObjectError::Malformed).

details may contain error info that may have been propagated from the download cache if the download cache itself has a malformed entry for the same file or it could contain error info during a previous attempt to compute the cfi cache entry.

@relaxolotl relaxolotl force-pushed the feat/recognize-extended-cache-statuses branch from e240e55 to 626a5cd Compare August 4, 2021 19:19
Base automatically changed from feat/recognize-extended-cache-statuses to master August 4, 2021 19:29
@relaxolotl relaxolotl changed the title feat(cache): Stuff error messages into Malformed and Download Error cache files feat(cache): Stuff error messages into Malformed and CacheSpecificError cache files Aug 4, 2021
@relaxolotl relaxolotl force-pushed the feat/stuff-messages-into-cache branch from 8288203 to 7722e79 Compare August 4, 2021 21:20
@relaxolotl relaxolotl changed the base branch from master to feat/per-cache-expiration-strats August 4, 2021 21:25
Base automatically changed from feat/per-cache-expiration-strats to master August 5, 2021 14:04
this has zero impact on how malformed entries behave. they only
include additional info that can be used for debugging, if
needed.

the only functional change is that the contents of malformed
cache entries may be a little longer, as they'll include an
error message.
this has zero impact on the existing behaviour of cache entries.
cache-specific error cache entries will have a little bit of extra
debugging info if needed during development.
@relaxolotl relaxolotl force-pushed the feat/stuff-messages-into-cache branch from 7722e79 to 378b8ba Compare August 5, 2021 15:02
@relaxolotl relaxolotl merged commit ac4b916 into master Aug 5, 2021
@relaxolotl relaxolotl deleted the feat/stuff-messages-into-cache branch August 5, 2021 16:31
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