-
Notifications
You must be signed in to change notification settings - Fork 517
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
Fix bug in delta xds server #458
Conversation
Signed-off-by: Sergey Matyukevich <s.matyukevich@gmail.com>
@s-matyukevich thanks for opening this bug fix! This looks good, you can ignore the nonce set in delta right now because it's not really used in envoy. But this definitely addresses the issues opened earlier with delta failing to respond. With regards to the termination channel, which go-control-plane/pkg/server/delta/v3/server.go Lines 177 to 182 in 7514008
Since we linearize the responses coming through |
Thanks for the quick review @alecholmez
The way how you handle this in the branch is exactly what I meant. Please disregard my comment about the for loop. |
Another problem that I see is that neither unit tests nor integration tests capture this. In our own control plane, we use "integration style" unit tests: we run the control plane server using I can copy come of our test to this repo if you like. They actually captured this bug. |
@s-matyukevich can you fix the conflicts? I'd like to get this in |
Signed-off-by: Sergey Matyukevich <s.matyukevich@gmail.com>
Sure, done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll approve once we get that channel close in
…into fix-delta-watchers
Signed-off-by: Sergey Matyukevich <s.matyukevich@gmail.com>
This looks great thanks for working this! |
Here is the description of the request flow that illustrates the bug
cache.CreateDeltaWatch
CreateDeltaWatch
function checks that resource already exists and responds immediately. delayedResponse is false so the new watch isn't created.deltaWatches
map here So the if statement below won't be executed, andcache.CreateDeltaWatch
won't be called for the second time.You can check this by simply running integration tests. Before this fix integration tests don't fail, but from the output, you can see that no updates are being sent to the client after the test runner prints
update snapshot
message.P.S: I think this function always puts a single object into
watches.deltaMuxedResponses
channel (because the cache always closes the watcher after sending a single response) so maybe, instead terminating this function by writing intoterminate
channels, we can simply get rid of the for loop and terminate the function after the first response is forwarded to thedeltaMuxedResponses
channel?