Closed
Description
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:
- Refactor router hierarchy to provide consistent approach for managing router mappings dynamically (e.g., ControlBus) [INT-1377] #5375 Refactor router hierarchy to provide consistent approach for managing router mappings dynamically (e.g., ControlBus)
Backported to: 2.0.6