Skip to content

Fix TestOOMError#testOOMCMLC throw ConcurrentModificationException #3059

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

Merged

Conversation

Wzy19930507
Copy link
Contributor

@Wzy19930507 Wzy19930507 commented Feb 22, 2024

TestOOMError#testOOMCMLC throw ConcurrentModificationException needs simultaneous invoke KafkaMessageListenerContainer#setStoppedNormally, ConcurrentMessageListenerContainer#isInExpectedState, modify property when stream.map().allMatch cause list size change.

Then assertThat container.isInExpectedState(), because of container maybe is not in expected state. concurrent container publishes one time, child container publishes concurrency time, CountDownLatch needs to modify to 2.

  • Fix TestOOMError#testOOMCMLC throw ConcurrentModificationException

TestOOMError > testOOMCMLC() FAILED
    java.util.ConcurrentModificationException
        at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1604)
        at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
        at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230)
        at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.allMatch(ReferencePipeline.java:637)

@Wzy19930507 Wzy19930507 changed the title Fix ConcurrentMessageListenerContainer.isInExpectedState consistency problem Fix ConcurrentMessageListenerContainer.isInExpectedState throw ConcurrentModificationException Feb 22, 2024
@Wzy19930507 Wzy19930507 force-pushed the fix_cmlc_consistency_problem branch from f55bbbb to 9136832 Compare February 22, 2024 14:04
TestOOMError#testOOMCMLC throw `ConcurrentModificationException` needs simultaneous invoke `KafkaMessageListenerContainer#setStoppedNormally`, `ConcurrentMessageListenerContainer#isInExpectedState, modify property when `stream`.

when assertThat container.isInExpectedState(), because of container maybe is not in expected state. concurrent container publishes one time, child container publishes concurrency time, CountDownLatch needs to modify to 2.

* Fix `TestOOMError#testOOMCMLC` throw `ConcurrentModificationException`
@Wzy19930507 Wzy19930507 force-pushed the fix_cmlc_consistency_problem branch from 9136832 to 973d10d Compare February 22, 2024 14:32
@Wzy19930507 Wzy19930507 changed the title Fix ConcurrentMessageListenerContainer.isInExpectedState throw ConcurrentModificationException Fix TestOOMError#testOOMCMLC throw ConcurrentModificationException Feb 22, 2024
@sobychacko sobychacko added this to the 3.2.0-M2 milestone Feb 22, 2024
@sobychacko sobychacko merged commit 562769d into spring-projects:main Feb 22, 2024
spring-builds pushed a commit that referenced this pull request Feb 22, 2024
Fixes: #3059

* Fix TestOOMError#testOOMCMLC throw ConcurrentModificationException due to a race condition in test

(cherry picked from commit 562769d)
@Wzy19930507 Wzy19930507 deleted the fix_cmlc_consistency_problem branch February 23, 2024 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants