Skip to content

Conversation

ramaraochavali
Copy link
Contributor

Description: Invokes initialization callbacks on remote close
Risk Level: Low
Testing: Changed existing automated tests
Docs Changes: N/A
Release Notes: N/A
Fixes #5622

Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
@mattklein123 mattklein123 self-assigned this Jan 22, 2019
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix. One question/comment.

/wait

@@ -268,7 +268,7 @@ void GrpcMuxImpl::onRemoteClose(Grpc::Status::GrpcStatus status, const std::stri
ENVOY_LOG(warn, "gRPC config stream closed: {}, {}", status, message);
stream_ = nullptr;
control_plane_stats_.connected_state_.set(0);
setRetryTimer();
handleFailure();
Copy link
Member

Choose a reason for hiding this comment

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

One thought here: If you don't want to consider this a failure for stat purposes, you could just invoke the initialize callbacks without calling handleFailure(). I don't mind either way but throwing it out there.

Either way we go, is it possible to craft a test specific to this issue? Can we do a remote close on the first call and make sure the initialize callbacks fire? Do the test changes below specifically cover that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I will leave it as is.

yes, the test covers the case that for 3 resource subscribes, the first response it self is Remote Close (with out any previous messages). If that is not what you are looking for, please LMK what you are looking for - I will try to craft that

Copy link
Member

Choose a reason for hiding this comment

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

I don't see an expectation that the initialized callbacks is called though. Can you add that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh. Sorry. I added it to grpc_mux_impl and thought I added it to subscription_impl as well. Added now - Is that what we are asking for?

Copy link
Member

Choose a reason for hiding this comment

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

Not exactly. There is an intialized callback that needs to be fired the first time any update/failure/etc. happens. Is the test expecting those? If not, can you add them, specifically for covering the bug we are fixing?

/wait

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. Are you referring to InitManager's initialize() callback? I may be missing some thing, but GrpcMuxImpl which these tests are written, does not have it injected. It is at higher level that it is called based on configupate/failed. Or there is a way to get InitiManager here?

Copy link
Member

Choose a reason for hiding this comment

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

Hmm sorry yes I see. OK yes I think this is right (we do the logic in config update failed). Will take a look again.

Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks! Sorry for the confusion about the init callback.

@mattklein123 mattklein123 merged commit 4ee55ce into envoyproxy:master Jan 23, 2019
@ramaraochavali ramaraochavali deleted the fix/grpc_remote_close branch January 23, 2019 16:38
danzh2010 pushed a commit to danzh2010/envoy that referenced this pull request Jan 24, 2019
)

Signed-off-by: Rama Chavali <rama.rao@salesforce.com>

Signed-off-by: Dan Zhang <danzh@google.com>
fredlas pushed a commit to fredlas/envoy that referenced this pull request Mar 5, 2019
)

Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Fred Douglas <fredlas@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Initialize with static config only when management server is not responding
2 participants