Skip to content

Inconsistent State Possible During Router Mapping Update [INT-2347] #6327

Closed
@spring-operator

Description

@spring-operator

Gary Russell opened INT-2347 and commented

AMMR (2.1); AMR (2.0).

In AM(M)R.setChannelMappings(), this.channelMappings is cleared and rebuilt in discrete, unprotected steps.

If a message arrives after the clear() and before the putAll() completes, it will be routed using an incomplete mapping table.

Suggest changing channelMappings to be volatile, and build a new one in setChannelMappings(), and atomically update the instance variable.

That way, a message will be routed using either the old or (complete) new mapping table.


Affects: 2.0.5, 2.1 RC2

Issue Links:

Backported to: 2.0.6

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions