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 flaky ReactiveWebServerLoadBalancerInteropTest #5999

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ikhoon
Copy link
Contributor

@ikhoon ikhoon commented Nov 22, 2024

Motivation:

com.linecorp.armeria.spring.web.reactive.ReactiveWebServerLoadBalancerInteropTest.[1] sessionProtocol=H1C, path=/controller/api/ping
java.util.ConcurrentModificationException
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1714)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at com.linecorp.armeria.spring.web.reactive.ReactiveWebServerLoadBalancerInteropTest.assertNoErrorLogByHttpWebHandlerAdapter(ReactiveWebServerLoadBalancerInteropTest.java:148)

It seems that logAppender.list was modified while retrieving elements

Modifications:

  • Use CopyOnWriteArrayList to collect ILoggingEvent

Result:

Fixes #5462

Motivation:

```
com.linecorp.armeria.spring.web.reactive.ReactiveWebServerLoadBalancerInteropTest.[1] sessionProtocol=H1C, path=/controller/api/ping
java.util.ConcurrentModificationException
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1714)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at com.linecorp.armeria.spring.web.reactive.ReactiveWebServerLoadBalancerInteropTest.assertNoErrorLogByHttpWebHandlerAdapter(ReactiveWebServerLoadBalancerInteropTest.java:148)
```

It seems that `logAppender.list` was modified while retrieving elements

Modifications:

- Use `CopyOnWriteArrayList` to collect `ILoggingEvent`

Result:

Fixes line#5462
Copy link
Member

@minwoox minwoox left a comment

Choose a reason for hiding this comment

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

👍 👍 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test failure: com.linecorp.armeria.spring.web.reactive.ReactiveWebServerLoadBalancerInteropTest
3 participants