Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.

Conversation

@aaronjwood
Copy link

I noticed that there was synchronization being done around a ConcurrentMap which would incur a performance hit. At first I thought this was maybe to make the get() + put() operations atomic but I only see one place where the map inside of the map (the value) is touched: Map existingTriggerMap = map.putIfAbsent(group, subMap);.

The other half of this patch addresses some inconsistent synchronization where some methods were synchronized while others were not. It looked like this would potentially cause the methods to work with inconsistent state.

int waitingFor = 2;
while (waitingFor > 0) {
final Map<String, Integer> map = scaleupActionsQ.poll(coolDownSecs, TimeUnit.SECONDS);
Assert.assertNotNull(map);
Copy link
Author

Choose a reason for hiding this comment

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

I thought that this needed adjusting but it looks like this assertion occasionally fails on master too.

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.

1 participant