Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: prevent possible concurrent modification of a collection #1370

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

triceo
Copy link
Contributor

@triceo triceo commented Jan 31, 2025

We have seen reports of the TreeMap getting concurrently accessed and throwing exceptions. Unfortunately, we have never seen any code to reproduce these failures, as concurrency issues are notoriously hard to reproduce. Therefore we refactor the mechanism to make any such issues impossible.

For the same reason as there is no reproducer, there is also no new test coverage. But existing test coverage still passes.

@triceo
Copy link
Contributor Author

triceo commented Jan 31, 2025

I have put this together with @rsynek, who is the original author of this code.
I also need a review from @zepfred, who touched this code most recently.
It's concurrency - one can never be too sure.

@triceo triceo added this to the v1.19.0 milestone Jan 31, 2025
@triceo triceo self-assigned this Jan 31, 2025
Copy link
Contributor

@zepfred zepfred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes have simplified the class's logic and look great to me!

We have seen reports of the TreeMap getting concurrently accessed and throwing exceptions. Unfortunately, we have never seen any code to reproduce these failures, as concurrency issues are notoriously hard to reproduce. Therefore we refactor the mechanism to make any such issues impossible.

For the same reason as there is no reproducer, there is also no new test coverage. But existing test coverage still passes.
Copy link
Contributor

@rsynek rsynek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that a part of locking has been replaced by immutability, that's nice.

@triceo triceo merged commit a7c8374 into TimefoldAI:main Jan 31, 2025
26 of 27 checks passed
@triceo triceo deleted the threads branch January 31, 2025 15:57
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants