Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Conversation

@valfirst
Copy link
Contributor

@valfirst valfirst commented Dec 8, 2020

The following exception is caused by concurrent read-write operations (proxy is adding new entries, while client is trying to read them):

java.util.ConcurrentModificationException
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1627)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
	at com.browserup.harreader.model.HarLog.findEntries(HarLog.java:178)
	at com.browserup.harreader.model.HarLog.findEntries(HarLog.java:172)

browsermob-proxy used CopyOnWriteArrayList which is thread-safe:
https://github.com/lightbody/browsermob-proxy/blob/master/browsermob-core/src/main/java/net/lightbody/bmp/core/har/HarLog.java#L13-L14

Copy link
Contributor

@ericbeland ericbeland left a comment

Choose a reason for hiding this comment

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

Looks great, and thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants