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

FELIX-6317 - Ensure the order of dynamic binding follows service rank #39

Merged
merged 1 commit into from
Aug 11, 2020

Conversation

tjwatson
Copy link
Member

@tjwatson tjwatson commented Aug 6, 2020

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.

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.
@tjwatson tjwatson merged commit 8d10caa into apache:master Aug 11, 2020
@tjwatson tjwatson deleted the FELIX-6317 branch August 12, 2020 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant