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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

all operations involving file reads were moved to background threads #1959

Merged

Conversation

stefanosiano
Copy link
Member

馃摐 Description

All operations involving IO have been moved to the background, as enabling the strict mode on Android was causing crashes

try {
this.device_cpu_frequencies = deviceCpuFrequenciesReader.call();
} catch (Exception e) {
this.device_cpu_frequencies = new ArrayList<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need that? device_cpu_frequencies is already created in the field declaration.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's just because I cannot leave exception block empty. Since there's no logger to log the exception i don't know if it's fine to call e.printStackTrace()

Copy link
Contributor

Choose a reason for hiding this comment

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

You can, do this:

} catch (Throwable ignored) {
      // should never happen
}

just name it ignored and add a comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

I previously did

} catch (Throwable ignored) {
}

without the comment and it was complaining. I added the comment and now it's fine, thanks!

@github-actions
Copy link
Contributor

Fails
馃毇 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- all operations involving file reads were moved to background threads ([#1959](https://github.com/getsentry/sentry-java/pull/1959))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 馃毇 dangerJS against 7836c79

@stefanosiano stefanosiano merged commit 4e0189c into feat/profiling/android Mar 28, 2022
@stefanosiano stefanosiano deleted the feat/profiling/android_traces_background branch March 28, 2022 13:45
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.

None yet

2 participants