Skip to content

ConcurrentModificationException for late-registered AbstractEndpoints #9878

Closed
@proggler23

Description

@proggler23

In what version(s) of Spring Integration are you seeing this issue?

6.4.2.RELEASE

Describe the bug

After executing a test, annotated with @SpringBootTest and @SpringIntegrationTest, we saw a ConcurrentModificationException happening in SpringIntegrationTestExecutionListener.

The underlying issue was, that some logic added a new integrationFlow late (after application started). With bad timings, this happened exactly during afterTestClass execution currently looping through all AutoStartupCandidates, resulting in the exception.

To Reproduce

Register a new bean, extending AbstractEndpoint with autostartup = true exactly on test shutdown.

Expected behavior

Probably only handle Autostartup candidates, that are received during the ApplicationContext initialization (stop adding Autostartup candidates after ApplicationStarted).

Sample

Sample project

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions