Test Picker poisoning when try to call Listener()
simultaneously with PickAsync()
#1
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.
This test shows situation when Picker become poisoned and cannot return valid pick results.
ConnectionManager.PickAsync(...)
, it started to execute and it callsawait ConnectionManager.GetPickerAsync(...)
.GetPickerAsync(...)
finishes execution, returns_nextPickerTcs.Task.WaitAsync(...)
which then awaited insidePickAsync(...)
.PollingResolver.Listener(...)
with new addresses. If addresses are really new then new subchannels will be created and at least one of them can getTransientFailure
when trying to connect.Listener(...)
with new addresses called just afterGetPickerAsync(...)
returns but before returned task completed and one of sunchannels hasTransientFailure
state) thenPicker
become poisoned forever. It will always returnErrorPicker
andcurrentPicker.Pick(...).Type
will bePickResultType.Fail
.For this situation to happen there should be client side balancing enabled with custom resolver,
ConnectionManager.PickAsync(...)
calls should be often, connections should sometimes be broken. Even if it seems to be rare case nevertheless it happened often enough under high load and intensive use.