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

Introduced thread-safety while updating field during deactivation phase #81

Merged
merged 1 commit into from Aug 9, 2021

Conversation

amitjoy
Copy link
Contributor

@amitjoy amitjoy commented Jul 21, 2021

The problem occurred when multiple injected services tried to be removed from the component's injection. It is highly likely because of the usage of TreeMap in such concurrent environment. Since TreeMap has never been written to be used in a concurrent environment, we should use ConcurrentSkipListMap instead as all the features of TreeMap have been introduced in ConcurrentSkipListMap and it is very much suitable for concurrent environment.

@amitjoy
Copy link
Contributor Author

amitjoy commented Jul 21, 2021

@cziegeler @tjwatson Could you kindly have a look at it?

@tjwatson
Copy link
Member

tjwatson commented Jul 21, 2021

When the problem occurred what sort of errors/warnings or incorrect behavior did you observe? Any stack trace?

[EDIT] - nevermind you put this in https://issues.apache.org/jira/browse/FELIX-6439

@amitjoy
Copy link
Contributor Author

amitjoy commented Jul 21, 2021

I have added the stacktrace to the JIRA bug report

The problem occurred when multiple injected services tried to be removed from the component's injection. It is highly likely because of the usage of TreeMap in such concurrent environment. Since TreeMap has never been written to be used in a concurrent environment, we should use ConcurrentSkipListMap instead as all the features of TreeMap have been introduced in ConcurrentSkipListMap and it is very much suitable for concurrent environment.
Introduced thread-safety while updating field during deactivation phase
@amitjoy amitjoy force-pushed the bug/FELIX-6439/npe-treemap branch from b873f57 to cf2cf3c Compare July 22, 2021 12:54
@amitjoy amitjoy changed the title [FELIX-6439] Removed use of 'TreeMap' in concurrent environment Introduced thread-safety while updating field during deactivation phase Jul 22, 2021
Copy link
Member

@tjwatson tjwatson left a comment

Choose a reason for hiding this comment

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

LGTM

@amitjoy
Copy link
Contributor Author

amitjoy commented Aug 9, 2021

@tjwatson Is it possible to merge this as it can then be part of the next SCR release?

@tjwatson tjwatson merged commit 6695a8a into apache:master Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants