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

Make Sentry.{close,get_main_hub} thread-safe #2436

Merged
merged 1 commit into from
Oct 20, 2024

Conversation

solnic
Copy link
Collaborator

@solnic solnic commented Oct 18, 2024

Since we're dealing with a bunch of global vars in Sentry.close, it should be wrapped in a mutex sync because threads may be accessing these vars while Sentry is closing, and THAT probably causes #2386 and #2396.

#skip-changelog

@solnic solnic requested review from st0012 and sl0thentr0py and removed request for st0012 October 18, 2024 08:23
@solnic
Copy link
Collaborator Author

solnic commented Oct 18, 2024

Sentry.initialized? should use a mutex too, given that it relies on @main_hub that may get reset to nil by Sentry.close

@solnic solnic force-pushed the solnic/make-closing-thread-safe branch from 2fea332 to ffc67f0 Compare October 18, 2024 21:15
@solnic solnic changed the title Make Sentry.close thread-safe Make Sentry.{close,get_main_hub} thread-safe Oct 18, 2024
@solnic solnic force-pushed the solnic/make-closing-thread-safe branch 3 times, most recently from e4669f2 to 4fe0b8d Compare October 18, 2024 21:34
Copy link

codecov bot commented Oct 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.17%. Comparing base (b4bbed2) to head (25454b2).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2436      +/-   ##
==========================================
- Coverage   98.34%   98.17%   -0.17%     
==========================================
  Files         126      126              
  Lines        4703     4725      +22     
==========================================
+ Hits         4625     4639      +14     
- Misses         78       86       +8     
Components Coverage Δ
sentry-ruby 98.51% <100.00%> (-0.14%) ⬇️
sentry-rails 97.19% <ø> (-0.76%) ⬇️
sentry-sidekiq 97.47% <ø> (+1.51%) ⬆️
sentry-resque 92.85% <ø> (+0.21%) ⬆️
sentry-delayed_job 95.65% <ø> (ø)
sentry-opentelemetry 99.31% <ø> (-0.69%) ⬇️
Files with missing lines Coverage Δ
sentry-ruby/lib/sentry-ruby.rb 99.54% <100.00%> (+<0.01%) ⬆️

... and 17 files with indirect coverage changes

@solnic solnic force-pushed the solnic/make-closing-thread-safe branch from 18118d5 to 4fe0b8d Compare October 19, 2024 21:07
@solnic solnic force-pushed the solnic/make-closing-thread-safe branch 2 times, most recently from b33e3dd to b76231d Compare October 20, 2024 21:33
@solnic solnic force-pushed the solnic/make-closing-thread-safe branch from b76231d to 25454b2 Compare October 20, 2024 21:40
@solnic solnic merged commit 957c8d6 into master Oct 20, 2024
138 of 139 checks passed
@solnic solnic deleted the solnic/make-closing-thread-safe branch October 20, 2024 21: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.

3 participants