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

Avoid calls the Thread.CurrentThread where possible #1466

Merged
merged 6 commits into from
Feb 11, 2022

Conversation

SimonCropp
Copy link
Contributor

No description provided.

@getsentry getsentry deleted a comment from codecov-commenter Feb 7, 2022
@@ -103,7 +103,7 @@ internal IEnumerable<SentryException> CreateSentryException(Exception exception)
Type = exception.GetType()?.FullName,
Module = exception.GetType()?.Assembly?.FullName,
Value = exception.Message,
ThreadId = Thread.CurrentThread.ManagedThreadId,
ThreadId = Environment.CurrentManagedThreadId,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we add a test that invokes MainExceptionProcessor and MainSentryEventProcessor to check if ThreadId and SentryThread.Id are equal?

Other than that, the PR looks good for me.

@codecov-commenter
Copy link

codecov-commenter commented Feb 11, 2022

Codecov Report

Merging #1466 (cbcb4de) into main (86c0fcd) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1466      +/-   ##
==========================================
- Coverage   84.26%   84.24%   -0.03%     
==========================================
  Files         219      219              
  Lines        7387     7388       +1     
  Branches     1417     1417              
==========================================
- Hits         6225     6224       -1     
- Misses        727      728       +1     
- Partials      435      436       +1     
Impacted Files Coverage Δ
src/Sentry/Internal/MainExceptionProcessor.cs 95.08% <100.00%> (ø)
src/Sentry/Internal/MainSentryEventProcessor.cs 97.36% <100.00%> (+0.02%) ⬆️
src/Sentry/Internal/BackgroundWorker.cs 92.02% <0.00%> (-1.45%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 86c0fcd...cbcb4de. Read the comment docs.

CHANGELOG.md Outdated Show resolved Hide resolved
@bruno-garcia bruno-garcia merged commit cb7ae0c into main Feb 11, 2022
@bruno-garcia bruno-garcia deleted the minor-thread-perf-tweaks branch February 11, 2022 14:55
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.

4 participants