Skip to content

MYFACES-4766: BeanPropertyTagRule: stop caching arguments and use volatile to prevent concurrency errors - #1084

Open
cocorossello wants to merge 6 commits into
apache:2.3-nextfrom
Travelcompositor:2.3-next
Open

cocorossello wants to merge 6 commits into
apache:2.3-nextfrom
Travelcompositor:2.3-next

Conversation

@cocorossello

Copy link
Copy Markdown

No description provided.

@melloware melloware added the bug Something isn't working label Sep 22, 2026
@tandraschko

Copy link
Copy Markdown
Member

Why not just make the old field Lazy<>?

@cocorossello

Copy link
Copy Markdown
Author

Why not just make the old field Lazy<>?

It's an option, but isn't this more complicated?

@tandraschko

Copy link
Copy Markdown
Member

Volatile/synchronized should not be required If you use it correctly. Lazy has a method arg, to resolve the value once

@cocorossello

Copy link
Copy Markdown
Author

Changed, but note that if getValue is not synchronized it may be initialized in more than 1 thread (it may be acceptable or better than synchronized anyway, I can remove it if you prefer)

… we want to prevent this to be possible initialized in more than one thread (which it may be acceptable)
@tandraschko

Copy link
Copy Markdown
Member

Lazy internally is synchronized
Please check it out

@tandraschko

Copy link
Copy Markdown
Member

Also we should avoid to instantiate the new array all the time

… each time. FaceletContext must be resolved, otherwise I would need to change Lazy class to pass the supplier as an argument
@tandraschko

Copy link
Copy Markdown
Member

Looks good for me, thanks
Can you test this in your environment, if its still fixed?

@tandraschko

Copy link
Copy Markdown
Member

@melloware build hangs, can you take over?

@cocorossello

cocorossello commented Sep 23, 2026

Copy link
Copy Markdown
Author

Tested in my environment, no more cases, I applied last change today. To be absolutely sure it should be running a few days, because it only happened once or twice per day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants