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

Fix watch on clusters, by removing inner Arc #773

Merged
merged 1 commit into from
Aug 11, 2023
Merged

Conversation

XAMPPRocky
Copy link
Collaborator

@XAMPPRocky XAMPPRocky commented Aug 10, 2023

This should actually fix the issue with changes not being sent across three services, and removes the constant re-checking for changes by finally fixing the issue with watching clusters. The bug was devilishly subtle, the Watch struct watches for changes between two values and sends if they change, however ClusterMap had inner Arc and thus both the value being held and the value in the channel were always the same.

I also added a ReadGuard and split it into read and write methods, so that's more clear what the intent is.

Copy link
Contributor

@markmandel markmandel left a comment

Choose a reason for hiding this comment

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

Nice find!

There's some code that's commented out (see comment) that I'm not sure if it was meant to be that way, but merge when ready otherwise.

tracing::info!("sending discovery request");
crate::xds::client::MdsStream::discovery_request_without_cache(&identifier, &mut requests, crate::xds::ResourceType::Cluster, &[])
.map_err(|error| tonic::Status::internal(error.to_string()))?;
// tracing::info!("sending discovery request");
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this meant to remain commented out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, they aren't needed anymore, but I went ahead and cleaned it up

@XAMPPRocky XAMPPRocky force-pushed the ep/fix-cluster-watch branch from 1981394 to b09d8b9 Compare August 11, 2023 06:25
@quilkin-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: 2df993a6-4d31-4b68-aab8-1e96a2c37ec6

The following development images have been built, and will exist for the next 30 days:

To build this version:

git fetch git@github.com:googleforgames/quilkin.git pull/773/head:pr_773 && git checkout pr_773
cargo build

@XAMPPRocky XAMPPRocky merged commit d742f1d into main Aug 11, 2023
@XAMPPRocky XAMPPRocky deleted the ep/fix-cluster-watch branch August 11, 2023 07:32
@markmandel markmandel added kind/bug Something isn't working area/user-experience Pertaining to developers trying to use Quilkin, e.g. cli interface, configuration, etc labels Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/user-experience Pertaining to developers trying to use Quilkin, e.g. cli interface, configuration, etc kind/bug Something isn't working size/m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants