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

fix race condition when using semantic methods #356

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

ccutrer
Copy link
Contributor

@ccutrer ccutrer commented Nov 17, 2024

Enumerable and predicate methods will now behave better when they refer to stale proxies - filtering methods will just remove them. I run into this occasionally when I have multiple rules firing, and some of them are adding or removing items - and calling items.locations would raise a NoMethodError for #location? due to a race condition. This should no longer happen - it will just ignore the now-stale items.

@jimtng jimtng added the bug Something isn't working label Nov 25, 2024
Enumerable and predicate methods will now behave better when they refer
to stale proxies - filtering methods will just remove them. I run into
this occasionally when I have multiple rules firing, and some of them
are adding or removing items - and calling items.locations would raise
a NoMethodError for #location? due to a race condition. This should no
longer happen - it will just ignore the now-stale items.

Signed-off-by: Cody Cutrer <[email protected]>
@ccutrer ccutrer merged commit 38af9a0 into openhab:main Nov 25, 2024
24 checks passed
@ccutrer ccutrer deleted the fix-semantic-race-condition branch November 25, 2024 23:24
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.

2 participants