René's URL Explorer Experiment


Title: Initialize SentryOptions members lazily · Issue #2541 · getsentry/sentry-java · GitHub

Open Graph Title: Initialize SentryOptions members lazily · Issue #2541 · getsentry/sentry-java

X Title: Initialize SentryOptions members lazily · Issue #2541 · getsentry/sentry-java

Description: Description When SentryOptions.empty() is used (e.g. in a NoOpHub), we still eagerly initialize some of the class members, for example: JsonSerializer ClientReportRecorder EnvelopeReader I think, those should be fine to initialize lazily...

Open Graph Description: Description When SentryOptions.empty() is used (e.g. in a NoOpHub), we still eagerly initialize some of the class members, for example: JsonSerializer ClientReportRecorder EnvelopeReader I think, t...

X Description: Description When SentryOptions.empty() is used (e.g. in a NoOpHub), we still eagerly initialize some of the class members, for example: JsonSerializer ClientReportRecorder EnvelopeReader I think, t...

Opengraph URL: https://github.com/getsentry/sentry-java/issues/2541

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Initialize SentryOptions members lazily","articleBody":"### Description\r\n\r\nWhen [SentryOptions.empty()](https://github.com/getsentry/sentry-java/blob/4b32504a16c1ffd2325208184a90b34a8252fb02/sentry/src/main/java/io/sentry/SentryOptions.java#L2047-L2049) is used (e.g. in a `NoOpHub`), we still eagerly initialize some of the class members, for example:\r\n* [JsonSerializer](https://github.com/getsentry/sentry-java/blob/4b32504a16c1ffd2325208184a90b34a8252fb02/sentry/src/main/java/io/sentry/SentryOptions.java#L105)\r\n* [ClientReportRecorder](https://github.com/getsentry/sentry-java/blob/4b32504a16c1ffd2325208184a90b34a8252fb02/sentry/src/main/java/io/sentry/SentryOptions.java#L369)\r\n* [EnvelopeReader](https://github.com/getsentry/sentry-java/blob/4b32504a16c1ffd2325208184a90b34a8252fb02/sentry/src/main/java/io/sentry/SentryOptions.java#L102)\r\n\r\nI think, those should be fine to initialize lazily, so in case of the empty options they do not cause potential issues. There was a recent customer report of an ANR caused by with Sentry frames in it (although the ANR is most likely not caused by Sentry, because there's nothing involved that should cause an ANR, but still we'd like to eliminate such issues):\r\n```\r\nmain (runnable):tid=1 systid=27171 \r\n       at io.sentry.JsonSerializer.\u003cinit>(JsonSerializer.java:84)\r\n       at io.sentry.SentryOptions.\u003cinit>(SentryOptions.java:99)\r\n       at io.sentry.SentryOptions.empty(SentryOptions.java:1899)\r\n       at io.sentry.NoOpHub.\u003cinit>(NoOpHub.java:14)\r\n       at io.sentry.NoOpHub.\u003cclinit>(NoOpHub.java:12)\r\n       at io.sentry.Sentry.\u003cclinit>(Sentry.java:29)\r\n       at io.sentry.HubAdapter.getSpan(HubAdapter.java:246)\r\n       at io.sentry.instrumentation.file.FileIOSpanManager.startSpan(FileIOSpanManager.java:26)\r\n       at io.sentry.instrumentation.file.SentryFileInputStream.init(SentryFileInputStream.java:65)\r\n       at io.sentry.instrumentation.file.SentryFileInputStream.access$000(SentryFileInputStream.java:22)\r\n       at io.sentry.instrumentation.file.SentryFileInputStream$Factory.create(SentryFileInputStream.java:137)\r\n       at com.google.firebase.crashlytics.internal.settings.CachedSettingsIo.readCachedSettings(CachedSettingsIo.java:56)\r\n       at com.google.firebase.crashlytics.internal.settings.SettingsController.getCachedSettingsData(SettingsController.java:235)\r\n       at com.google.firebase.crashlytics.internal.settings.SettingsController.loadSettingsData(SettingsController.java:169)\r\n       at com.google.firebase.crashlytics.internal.settings.SettingsController.loadSettingsData(SettingsController.java:154)\r\n       at com.google.firebase.crashlytics.FirebaseCrashlytics.init(FirebaseCrashlytics.java:136)\r\n       at com.google.firebase.crashlytics.CrashlyticsRegistrar.buildCrashlytics(CrashlyticsRegistrar.java:57)\r\n       at com.google.firebase.crashlytics.CrashlyticsRegistrar.$r8$lambda$Pfd5XmDCFzNyAT9o9H6rDnTBQE4(CrashlyticsRegistrar.java)\r\n       at com.google.firebase.crashlytics.CrashlyticsRegistrar$$InternalSyntheticLambda$1$ab347a8933944304e42539e3f0bc7a2eb5ded1d56c7a52feedae47ac52780cf7$0.create(CrashlyticsRegistrar.java:2)\r\n       at com.google.firebase.components.ComponentRuntime.lambda$discoverComponents$0(ComponentRuntime.java:132)\r\n       at com.google.firebase.components.ComponentRuntime.$r8$lambda$4FqOW9eOQsvFYo-HpMfxCOnPQr0(ComponentRuntime.java)\r\n       at com.google.firebase.components.ComponentRuntime$$InternalSyntheticLambda$0$784536aca87f12f75d3504e86fd606a2ca102f8312a2daf2c8c51b9b25617f63$0.get(ComponentRuntime.java:4)\r\n       at com.google.firebase.components.Lazy.get(Lazy.java:53)\r\n       at com.google.firebase.components.ComponentRuntime.doInitializeEagerComponents(ComponentRuntime.java:291)\r\n       at com.google.firebase.components.ComponentRuntime.initializeEagerComponents(ComponentRuntime.java:281)\r\n       at com.google.firebase.FirebaseApp.initializeAllApis(FirebaseApp.java:584)\r\n       at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:303)\r\n       at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:267)\r\n       at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:252)\r\n       at com.google.firebase.provider.FirebaseInitProvider.onCreate(FirebaseInitProvider.java:51)\r\n       at android.content.ContentProvider.attachInfo(ContentProvider.java:2404)\r\n       at android.content.ContentProvider.attachInfo(ContentProvider.java:2374)\r\n       at com.google.firebase.provider.FirebaseInitProvider.attachInfo(FirebaseInitProvider.java:45)\r\n       at android.app.ActivityThread.installProvider(ActivityThread.java:7524)\r\n       at android.app.ActivityThread.installContentProviders(ActivityThread.java:7041)\r\n       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6790)\r\n       at android.app.ActivityThread.access$1600(ActivityThread.java:255)\r\n       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2100)\r\n       at android.os.Handler.dispatchMessage(Handler.java:106)\r\n       at android.os.Looper.loopOnce(Looper.java:201)\r\n       at android.os.Looper.loop(Looper.java:288)\r\n       at android.app.ActivityThread.main(ActivityThread.java:7941)\r\n       at java.lang.reflect.Method.invoke(Method.java)\r\n       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)\r\n       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1009)\r\n```","author":{"url":"https://github.com/romtsn","@type":"Person","name":"romtsn"},"datePublished":"2023-02-14T20:50:25Z","url":"https://github.com/getsentry/sentry-java/issues/2541"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:10736cdd-91c9-e05f-5d85-7c988b80887f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE820:29CA94:8D767A:C1FB5B:6B04809C
html-safe-nonce846efca72e71a4d3cc0e8c47b458fe91ab3750193423871a153a070c6c564e53
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODIwOjI5Q0E5NDo4RDc2N0E6QzFGQjVCOjZCMDQ4MDlDIiwidmlzaXRvcl9pZCI6IjEyMjEwNzc3MjgyNDIyMDQ4MjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaccfbf66030d551a7de2ac090710a2ae5b5f87aaa649f07a105d9d5ca2b4646c1b
hovercard-subject-tagissue:1584808036
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-java/2541/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ac0de5b6de87f938b5dada32fafcd9aa825b36d636018369c859766330b39194/getsentry/sentry-java/issues/2541
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ac0de5b6de87f938b5dada32fafcd9aa825b36d636018369c859766330b39194/getsentry/sentry-java/issues/2541
og:image:altDescription When SentryOptions.empty() is used (e.g. in a NoOpHub), we still eagerly initialize some of the class members, for example: JsonSerializer ClientReportRecorder EnvelopeReader I think, t...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameromtsn
hostnamegithub.com
expected-hostnamegithub.com
None0366ddfb372682a32e92a5d86155cb08fa83e5bbe79953a968789f2f7e24c511
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-java git https://github.com/getsentry/sentry-java.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id3368190
octolytics-dimension-repository_nwogetsentry/sentry-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3368190
octolytics-dimension-repository_network_root_nwogetsentry/sentry-java
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseed3f2e01f6b7672780c586c8af0e72726374d7b6
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-java/issues/2541#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-java%2Fissues%2F2541
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-java%2Fissues%2F2541
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-java
Reloadhttps://github.com/getsentry/sentry-java/issues/2541
Reloadhttps://github.com/getsentry/sentry-java/issues/2541
Reloadhttps://github.com/getsentry/sentry-java/issues/2541
getsentryhttps://github.com/getsentry
sentry-javahttps://github.com/getsentry/sentry-java
Codehttps://github.com/getsentry/sentry-java
Issues266 (266)https://github.com/getsentry/sentry-java/issues
Pull requests57 (57)https://github.com/getsentry/sentry-java/pulls
Discussionshttps://github.com/getsentry/sentry-java/discussions
Actionshttps://github.com/getsentry/sentry-java/actions
Projectshttps://github.com/getsentry/sentry-java/projects
Security and quality2 (2)https://github.com/getsentry/sentry-java/security
Insightshttps://github.com/getsentry/sentry-java/insights
https://github.com/getsentry/sentry-java
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-java/issues/2541
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-java/issues/2541
#3749https://github.com/getsentry/sentry-java/pull/3749
Initialize SentryOptions members lazilyhttps://github.com/getsentry/sentry-java/issues/2541#top
#3749https://github.com/getsentry/sentry-java/pull/3749
8.0.0https://github.com/getsentry/sentry-java/milestone/9
https://github.com/romtsn
romtsnhttps://github.com/romtsn
on Feb 14, 2023https://github.com/getsentry/sentry-java/issues/2541#issue-1584808036
SentryOptions.empty()https://github.com/getsentry/sentry-java/blob/4b32504a16c1ffd2325208184a90b34a8252fb02/sentry/src/main/java/io/sentry/SentryOptions.java#L2047-L2049
JsonSerializerhttps://github.com/getsentry/sentry-java/blob/4b32504a16c1ffd2325208184a90b34a8252fb02/sentry/src/main/java/io/sentry/SentryOptions.java#L105
ClientReportRecorderhttps://github.com/getsentry/sentry-java/blob/4b32504a16c1ffd2325208184a90b34a8252fb02/sentry/src/main/java/io/sentry/SentryOptions.java#L369
EnvelopeReaderhttps://github.com/getsentry/sentry-java/blob/4b32504a16c1ffd2325208184a90b34a8252fb02/sentry/src/main/java/io/sentry/SentryOptions.java#L102
romtsnhttps://github.com/romtsn
Platform: Javahttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Platform%3A%20Java%22
Effort: Smallhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Effort%3A%20Small%22
Impact: Smallhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Impact%3A%20Small%22
on Feb 14, 2023https://github.com/getsentry/sentry-java/issues/2541#event-8519643190
adinauerhttps://github.com/adinauer
Platform: Androidhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Platform%3A%20Android%22
on Feb 15, 2023https://github.com/getsentry/sentry-java/issues/2541#event-8524948160
https://github.com/markushi
markushihttps://github.com/markushi
on Feb 15, 2023https://github.com/getsentry/sentry-java/issues/2541#issuecomment-1431509775
kahesthttps://github.com/kahest
Impact: Smallhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Impact%3A%20Small%22
Effort: Smallhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Effort%3A%20Small%22
on Jul 11, 2023https://github.com/getsentry/sentry-java/issues/2541#event-9789425290
adinauerhttps://github.com/adinauer
8.0.0https://github.com/getsentry/sentry-java/milestone/9
on Apr 24, 2024https://github.com/getsentry/sentry-java/issues/2541#event-12593120509
romtsnhttps://github.com/romtsn
completedhttps://github.com/getsentry/sentry-java/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#3749https://github.com/getsentry/sentry-java/pull/3749
on Oct 8, 2024https://github.com/getsentry/sentry-java/issues/2541#event-14559545375
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-java/issues/2541
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-java/issues/2541
8.0.0No due datehttps://github.com/getsentry/sentry-java/milestone/9
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.