FELIX-6317 - Ensure the order of dynamic binding follows service rank #39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If multiple threads register higher ranked services than
the currently bound service then a single thread is
selected to do the work of binding the highest ranked
service. The other threads just queue up the possible
service to be bound by the winning thread.
This ensures that the component will not
get out of order bindings for the various service
registration when a component has a dynamic, greedy reference
with cardinality of 0..1 or 1..1
A new testcase is added that registers 100 services with
different ranks using 10 threads. The test then confirms
that the highest ranked service is the current one bound
to the component. Theoretically the test could pass before
this fix, but multiple runs without the fix never resulted
in a passing test.