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

Weld uses synchronized in ApplicationScopedContextualInstanceStrategy, so carrier thread is pinned #8739

Closed
ljnelson opened this issue May 9, 2024 · 1 comment
Labels
4.x Version 4.x
Projects

Comments

@ljnelson
Copy link
Member

ljnelson commented May 9, 2024

(This is not a Helidon issue, but more of a tracking issue to keep track of Weld's JIRA progress.)

See WELD-2788.

We have a user who has an application-scoped bean that does lots of expensive, IO-intensive work in its constructor. This is not a good thing to do under any circumstances, but Weld could be a little nicer here.

Specifically, Weld currently uses the synchronized keyword to ensure that (as you would expect) one and only one instance of the application-scoped bean is ever created. This is not virtual thread-friendly.

If it used Lock instead, then it would be virtual thread-friendly. WELD-2788 represents a probe to see if they'll be receptive to a PR that does this.

To reiterate, the proper thing is for the construction of a bean NOT to do lots of expensive IO.

@github-actions github-actions bot added this to Triage in Backlog May 9, 2024
@barchetta barchetta added the 4.x Version 4.x label May 9, 2024
@ljnelson
Copy link
Member Author

Addressed: weld/core#2978

Backlog automation moved this from Triage to Closed May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x
Projects
Backlog
  
Closed
Development

No branches or pull requests

2 participants