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

ConcurrentModificationException in Datafeed loop #475

Closed
symphony-youri opened this issue Mar 16, 2021 · 0 comments · Fixed by #476
Closed

ConcurrentModificationException in Datafeed loop #475

symphony-youri opened this issue Mar 16, 2021 · 0 comments · Fixed by #476
Assignees
Labels
[type] bug Something isn't working
Milestone

Comments

@symphony-youri
Copy link
Contributor

Bug Report

A ConcurrentModificationException can happen in the Datafeed (DF) loop upon startup.

The access to the listeners collection in the DF loop is not protected and accessed by multiple threads. Synchronizing the list should help to that matter.

Steps to Reproduce:

This is not always happening but restarting a bot using the DF loop and receiving events while starting should raise the issue.

Expected Result:

No exception.

Actual Result:

2021-03-15T17:28:38,530Z DEBUG [SymphonyBdk_DatafeedThread-111] c.s.b.c.r.RetryWithRecovery : Exception recovered
java.util.ConcurrentModificationException: null
	at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:911) ~[?:1.8.0_272]
	at java.util.ArrayList$Itr.next(ArrayList.java:861) ~[?:1.8.0_272]
	at com.symphony.bdk.core.service.datafeed.impl.AbstractDatafeedLoop.handleV4EventList(AbstractDatafeedLoop.java:82) ~[symphony-bdk-core-2.1.1.jar!/:2.1.1]
	at com.symphony.bdk.core.service.datafeed.impl.DatafeedLoopV1.readAndHandleEvents(DatafeedLoopV1.java:109) ~[symphony-bdk-core-2.1.1.jar!/:2.1.1]
	at com.symphony.bdk.core.retry.RetryWithRecovery.executeOnce(RetryWithRecovery.java:95) ~[symphony-bdk-core-2.1.1.jar!/:2.1.1]
	at io.github.resilience4j.retry.Retry.lambda$decorateCheckedSupplier$3f69f149$1(Retry.java:137) ~[resilience4j-retry-1.5.0.jar!/:1.5.0]
	at io.github.resilience4j.retry.Retry.executeCheckedSupplier(Retry.java:419) ~[resilience4j-retry-1.5.0.jar!/:1.5.0]
	at com.symphony.bdk.core.retry.resilience4j.Resilience4jRetryWithRecovery.execute(Resilience4jRetryWithRecovery.java:65) ~[symphony-bdk-core-2.1.1.jar!/:2.1.1]
	at com.symphony.bdk.core.service.datafeed.impl.DatafeedLoopV1.readDatafeed(DatafeedLoopV1.java:121) ~[symphony-bdk-core-2.1.1.jar!/:2.1.1]
	at com.symphony.bdk.core.service.datafeed.impl.DatafeedLoopV1.start(DatafeedLoopV1.java:86) ~[symphony-bdk-core-2.1.1.jar!/:2.1.1]
	at com.symphony.bdk.spring.service.DatafeedAsyncLauncherService.uncheckedStart(DatafeedAsyncLauncherService.java:88) ~[symphony-bdk-core-spring-boot-starter-2.1.1.jar!/:2.1.1]
	at com.symphony.bdk.http.api.tracing.MDCUtils$MdcRunnable.run(MDCUtils.java:59) [symphony-bdk-http-api-2.1.1.jar!/:2.1.1]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_272]
@symphony-youri symphony-youri added the [type] bug Something isn't working label Mar 16, 2021
@symphony-youri symphony-youri self-assigned this Mar 16, 2021
symphony-youri added a commit to symphony-youri/symphony-api-client-java that referenced this issue Mar 17, 2021
A ConcurrentModificationException can happen in the Datafeed (DF) loop upon startup.
The access to the listeners collection in the DF loop is not protected
and accessed by multiple threads.

Because of the for loop we need to synchronize on the list itself.
symphony-youri added a commit that referenced this issue Mar 17, 2021
A ConcurrentModificationException can happen in the Datafeed (DF) loop upon startup.
The access to the listeners collection in the DF loop is not protected
and accessed by multiple threads.

Because of the for loop we need to synchronize on the list itself.
symphony-youri added a commit to symphony-youri/symphony-api-client-java that referenced this issue Mar 17, 2021
…#476)

A ConcurrentModificationException can happen in the Datafeed (DF) loop upon startup.
The access to the listeners collection in the DF loop is not protected
and accessed by multiple threads.

Because of the for loop we need to synchronize on the list itself.

(cherry picked from commit c9fc39c)
symphony-youri added a commit that referenced this issue Mar 17, 2021
…on-exception-df-loop-backport-2-1

Backport of #475 and prepare release 2.1.3
@thibauult thibauult added this to the 2.1.3 milestone Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[type] bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants