-
Notifications
You must be signed in to change notification settings - Fork 15
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
add dealine to close main server info fetch stream for unary rpcs. #146
Conversation
Signed-off-by: Rahman Abber Tahir <[email protected]>
31f87fd
to
5e982e1
Compare
Now when we have such hangs we would see:
|
Hi @rainerschoe, as we discussed about the 'gwhisper hangs when server fails to close the reflection stream' |
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.
Thanks for the PR (even if it is closed now). See my comment on your default timeout. This could actually work, when we close the reflection stream early enough.
@@ -315,7 +326,11 @@ void ProtoReflectionDescriptorDatabase::AddFileFromResponse( | |||
|
|||
const std::shared_ptr<ProtoReflectionDescriptorDatabase::ClientStream> | |||
ProtoReflectionDescriptorDatabase::GetStream() { | |||
if (!stream_) { | |||
if (!stream_) //only assign deadline to a unary rpc. |
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 think this is not the place you are looking for.
It is kind of a stream singleton constructor. if stream does not exist it is creating it.
reflection is always a stream.
@@ -31,6 +31,7 @@ using grpc::reflection::v1alpha::ServerReflection; | |||
using grpc::reflection::v1alpha::ServerReflectionRequest; | |||
using grpc::reflection::v1alpha::ServerReflectionResponse; | |||
|
|||
const uint8_t g_timeoutGrpcMainStreamSeconds = 10; //using default gwhisper timeout of 10 seconds. |
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 have a new idea:
gWhisper uses reflection only BEFORE running the actual user-requested RPC:
- gWhisper starts parsing CLI arguments until hostname
- once hostname is known, reflection stream is established with the server and via multiple requests all the RPC names and type information is fetched from the reflection endpoint while CLI args are parsed and verified against this.
- The parsed CLI args are converted into a protobuf message
- The actual RPC is called as requested with the user (may be streaming or unary RPC)
- response is formatted and printed
I would need to verify, but I guess that currently, we keep the reflection stream open for the whole duration. which causes problems when using a fixed reflection deadline.
What we could do is close the reflection stream after 2 or 3. This way we could set a fixed reflection stream RPC timeout and we would not influence 4, even if the user executes a very long-running RPC.
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.
Hi @rainerschoe thanks for the review. I did see some deficiencies via functional tests and I like your idea of closing the desc stream early.
Hence, in the new PR #147
- Dynamic deadlines are now propagated to the DescDb stream.
- The db stream stream is now closed after 2.
Signed-off-by: Rahman Abber Tahir [email protected]