René's URL Explorer Experiment


Title: Virtual thread pinning on MainEventProcessor.ensureHostnameCache · Issue #3312 · getsentry/sentry-java · GitHub

Open Graph Title: Virtual thread pinning on MainEventProcessor.ensureHostnameCache · Issue #3312 · getsentry/sentry-java

X Title: Virtual thread pinning on MainEventProcessor.ensureHostnameCache · Issue #3312 · getsentry/sentry-java

Description: Problem Statement We use Java 21 and Spring Boot 3.2.4 with enabled virtual threads in plain web application. First request after app init leads to thread pinning: io.sentry.MainEventProcessor.ensureHostnameCache(MainEventProcessor.java:...

Open Graph Description: Problem Statement We use Java 21 and Spring Boot 3.2.4 with enabled virtual threads in plain web application. First request after app init leads to thread pinning: io.sentry.MainEventProcessor.ensu...

X Description: Problem Statement We use Java 21 and Spring Boot 3.2.4 with enabled virtual threads in plain web application. First request after app init leads to thread pinning: io.sentry.MainEventProcessor.ensu...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Virtual thread pinning on MainEventProcessor.ensureHostnameCache","articleBody":"### Problem Statement\n\nWe use Java 21 and Spring Boot 3.2.4 with enabled virtual threads in plain web application. First request after app init leads to thread pinning: ` io.sentry.MainEventProcessor.ensureHostnameCache(MainEventProcessor.java:192) \u003c== monitors:1`. Subsequent requests are fine.\r\n```java\r\nThread[#143,ForkJoinPool-1-worker-1,5,CarrierThreads]\r\n    java.base/java.lang.VirtualThread$VThreadContinuation.onPinned(VirtualThread.java:185)\r\n    java.base/jdk.internal.vm.Continuation.onPinned0(Continuation.java:393)\r\n    java.base/java.lang.VirtualThread.parkNanos(VirtualThread.java:631)\r\n    java.base/java.lang.System$2.parkVirtualThread(System.java:2648)\r\n    java.base/jdk.internal.misc.VirtualThreads.park(VirtualThreads.java:67)\r\n    java.base/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:267)\r\n    java.base/java.util.concurrent.FutureTask.awaitDone(FutureTask.java:497)\r\n    java.base/java.util.concurrent.FutureTask.get(FutureTask.java:203)\r\n    io.sentry.HostnameCache.updateCache(HostnameCache.java:121)\r\n    io.sentry.HostnameCache.\u003cinit>(HostnameCache.java:77)\r\n    io.sentry.HostnameCache.\u003cinit>(HostnameCache.java:64)\r\n    io.sentry.HostnameCache.\u003cinit>(HostnameCache.java:58)\r\n    io.sentry.HostnameCache.getInstance(HostnameCache.java:52)\r\n    io.sentry.MainEventProcessor.ensureHostnameCache(MainEventProcessor.java:192) \u003c== monitors:1\r\n    io.sentry.MainEventProcessor.setServerName(MainEventProcessor.java:181)\r\n    io.sentry.MainEventProcessor.processNonCachedEvent(MainEventProcessor.java:132)\r\n    io.sentry.MainEventProcessor.process(MainEventProcessor.java:146)\r\n    io.sentry.SentryClient.processTransaction(SentryClient.java:416)\r\n    io.sentry.SentryClient.captureTransaction(SentryClient.java:661)\r\n    io.sentry.Hub.captureTransaction(Hub.java:700)\r\n    io.sentry.SentryTracer.finish(SentryTracer.java:264)\r\n    io.sentry.SentryTracer.finish(SentryTracer.java:565)\r\n    io.sentry.SentryTracer.finish(SentryTracer.java:558)\r\n    io.sentry.SentryTracer.finish(SentryTracer.java:553)\r\n    io.sentry.spring.jakarta.tracing.SentryTracingFilter.doFilterWithTransaction(SentryTracingFilter.java:127)\r\n    io.sentry.spring.jakarta.tracing.SentryTracingFilter.doFilterInternal(SentryTracingFilter.java:87)\r\n    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)\r\n    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)\r\n    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)\r\n    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)\r\n    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)\r\n    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)\r\n    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)\r\n    io.sentry.spring.jakarta.SentrySpringFilter.doFilterInternal(SentrySpringFilter.java:71)\r\n    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)\r\n    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)\r\n    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)\r\n    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)\r\n    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)\r\n    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)\r\n    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)\r\n    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)\r\n    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)\r\n    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)\r\n    org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391)\r\n    org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)\r\n    org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896)\r\n    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1744)\r\n    org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)\r\n    java.base/java.lang.VirtualThread.run(VirtualThread.java:311)\r\n```\r\nThis behavior is observed in Sentry 7.6.0 and 6.26.0 \n\n### Solution Brainstorm\n\nWould be nice if Sentry became Loom-friendly and replace synchronized methods to ReentrantLock for virtual thread support.\r\n\r\nFrom this\r\n```java\r\nprivate void ensureHostnameCache() {\r\n    if (hostnameCache == null) {\r\n      synchronized (this) {\r\n        if (hostnameCache == null) {\r\n          hostnameCache = HostnameCache.getInstance();\r\n        }\r\n      }\r\n    }\r\n  }\r\n```\r\n\r\nTo this:\r\n```java\r\n    private final ReentrantLock lock = new ReentrantLock();\r\n\r\n    private void ensureHostnameCache() {\r\n        if (hostnameCache == null) {\r\n            lock.lock();\r\n            try {\r\n                if (hostnameCache == null) {\r\n                    hostnameCache = HostnameCache.getInstance();\r\n                }\r\n            } finally {\r\n                lock.unlock();\r\n            }\r\n        }\r\n    }\r\n```","author":{"url":"https://github.com/pavelbelonosov","@type":"Person","name":"pavelbelonosov"},"datePublished":"2024-04-02T15:24:00Z","url":"https://github.com/getsentry/sentry-java/issues/3312"}

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:fab2944d-6d74-660a-e824-8bdd66b32417
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8470:3ABDFB:7710B9:A29CC1:6B0479FD
html-safe-nonce14fc418bfe3dcc494bc4601b83a39a4ae0fcea40b0915b9fd969d42d332f735a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDcwOjNBQkRGQjo3NzEwQjk6QTI5Q0MxOjZCMDQ3OUZEIiwidmlzaXRvcl9pZCI6IjU0NjczOTk4Mjk1MTA3MTU5MDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac597da57ec912c0bb320f520370aae1880930cc15cfe9178eb904d2c2e14efe68
hovercard-subject-tagissue:2220812434
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/3312/issue_layout
twitter:imagehttps://opengraph.githubassets.com/adbd9e3470209ad96fe055b85f1c2794732bfcfead796ddb3feeca981142a86a/getsentry/sentry-java/issues/3312
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/adbd9e3470209ad96fe055b85f1c2794732bfcfead796ddb3feeca981142a86a/getsentry/sentry-java/issues/3312
og:image:altProblem Statement We use Java 21 and Spring Boot 3.2.4 with enabled virtual threads in plain web application. First request after app init leads to thread pinning: io.sentry.MainEventProcessor.ensu...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepavelbelonosov
hostnamegithub.com
expected-hostnamegithub.com
None9c099f1b85def81ca352464c276510dfef32deaf3c305404e65b8d270284a58b
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
releasecf73f57448d52b3a7b619195e182b33d3b3454ca
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-java/issues/3312#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-java%2Fissues%2F3312
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%2F3312
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/3312
Reloadhttps://github.com/getsentry/sentry-java/issues/3312
Reloadhttps://github.com/getsentry/sentry-java/issues/3312
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/3312
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-java/issues/3312
Virtual thread pinning on MainEventProcessor.ensureHostnameCachehttps://github.com/getsentry/sentry-java/issues/3312#top
https://github.com/adinauer
8.0.0https://github.com/getsentry/sentry-java/milestone/9
https://github.com/pavelbelonosov
pavelbelonosovhttps://github.com/pavelbelonosov
on Apr 2, 2024https://github.com/getsentry/sentry-java/issues/3312#issue-2220812434
pavelbelonosovhttps://github.com/pavelbelonosov
Platform: Javahttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Platform%3A%20Java%22
on Apr 2, 2024https://github.com/getsentry/sentry-java/issues/3312#event-12327906809
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Apr 2, 2024https://github.com/getsentry/sentry-java/issues/3312#event-12327907339
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 2https://github.com/orgs/getsentry/projects/190
on Apr 2, 2024https://github.com/getsentry/sentry-java/issues/3312#event-14896017806
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 2https://github.com/orgs/getsentry/projects/190
on Apr 2, 2024https://github.com/getsentry/sentry-java/issues/3312
https://github.com/adinauer
adinauerhttps://github.com/adinauer
on Apr 5, 2024https://github.com/getsentry/sentry-java/issues/3312#issuecomment-2039604563
@pavelbelonosovhttps://github.com/pavelbelonosov
ReentrantLockhttps://developer.android.com/reference/java/util/concurrent/locks/ReentrantLock
This classhttps://github.com/rbygrave/pgjdbc/blob/d7267a7830902f4b9cf4ea36f439ceb2f73bb929/pgjdbc/src/main/java/org/postgresql/jdbc/ResourceLock.java
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Apr 5, 2024https://github.com/getsentry/sentry-java/issues/3312#event-12372778967
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 2https://github.com/orgs/getsentry/projects/190
on Apr 5, 2024https://github.com/getsentry/sentry-java/issues/3312
adinauerhttps://github.com/adinauer
Platform: Androidhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Platform%3A%20Android%22
on Apr 5, 2024https://github.com/getsentry/sentry-java/issues/3312#event-12372782577
stefanosianohttps://github.com/stefanosiano
Platform: Androidhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Platform%3A%20Android%22
on Apr 10, 2024https://github.com/getsentry/sentry-java/issues/3312#event-12421601570
adinauerhttps://github.com/adinauer
8.0.0https://github.com/getsentry/sentry-java/milestone/9
on Apr 17, 2024https://github.com/getsentry/sentry-java/issues/3312#event-12500607292
https://github.com/tkrason
tkrasonhttps://github.com/tkrason
on Aug 20, 2024https://github.com/getsentry/sentry-java/issues/3312#issuecomment-2299571840
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Aug 20, 2024https://github.com/getsentry/sentry-java/issues/3312#event-13949701998
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Aug 20, 2024https://github.com/getsentry/sentry-java/issues/3312#event-14793872692
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Aug 20, 2024https://github.com/getsentry/sentry-java/issues/3312
https://github.com/adinauer
adinauerhttps://github.com/adinauer
on Aug 23, 2024https://github.com/getsentry/sentry-java/issues/3312#issuecomment-2306485520
@tkrasonhttps://github.com/tkrason
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Aug 23, 2024https://github.com/getsentry/sentry-java/issues/3312#event-13989417984
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Aug 23, 2024https://github.com/getsentry/sentry-java/issues/3312
adinauerhttps://github.com/adinauer
on Sep 2, 2024https://github.com/getsentry/sentry-java/issues/3312#event-14101670925
adinauerhttps://github.com/adinauer
completedhttps://github.com/getsentry/sentry-java/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Oct 15, 2024https://github.com/getsentry/sentry-java/issues/3312#event-14657653816
https://github.com/adinauer
adinauerhttps://github.com/adinauer
on Oct 16, 2024https://github.com/getsentry/sentry-java/issues/3312#issuecomment-2416113945
@pavelbelonosovhttps://github.com/pavelbelonosov
@tkrasonhttps://github.com/tkrason
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-java/issues/3312
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-java/issues/3312
adinauerhttps://github.com/adinauer
GitHub Issues with 👀 2https://github.com/orgs/getsentry/projects/190
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
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.