Skip to content

[chttp2] Continue refactoring towards promises#34437

Merged
ctiller merged 58 commits intogrpc:masterfrom
ctiller:ping-v2
Sep 28, 2023
Merged

[chttp2] Continue refactoring towards promises#34437
ctiller merged 58 commits intogrpc:masterfrom
ctiller:ping-v2

Conversation

@ctiller
Copy link
Copy Markdown
Member

@ctiller ctiller commented Sep 22, 2023

Isolate ping callback tracking to its own file.
Also takes the opportunity to simplify keepalive code by applying the ping timeout to all pings.
Adds an experiment to allow multiple pings outstanding too (this was originally an accidental behavior change of the work, but one that I think may be useful going forward).

@ctiller ctiller added the release notes: no Indicates if PR should not be in release notes label Sep 25, 2023
@ctiller ctiller requested a review from yashykt September 25, 2023 17:20
t->keepalive_ping_timer_handle.reset();
}
}
if (t->keepalive_watchdog_timer_handle.has_value()) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why is this being removed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it's subsumed by the timeout per-outstanding-ping

/** How many pings do we allow to be inflight at any given time?
In older versions of gRPC this was implicitly 1.
With the multiping experiment we allow this to rise to 100 by default. */
#define GRPC_ARG_HTTP2_MAX_INFLIGHT_PINGS "grpc.http2.max_inflight_pings"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe we don't need to expose this channel arg

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

happy to move the definition internally for a bit... would like to keep the escape hatch for the moment though

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

moved it private, but left the knob for now

@ctiller ctiller requested a review from yashykt September 27, 2023 23:09
Copy link
Copy Markdown
Member

@yashykt yashykt left a comment

Choose a reason for hiding this comment

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

My only comment is around documentation, for some explanation whereever it makes sense. Thanks!

grpc_chttp2_transport::~grpc_chttp2_transport() {
size_t i;

cancel_pings(this, GRPC_ERROR_CREATE("Transport destroyed"));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

note that pings need event engine so this needs to be cancelled before event engine

explicit GracefulGoaway(grpc_chttp2_transport* t) : t_(t->Ref()) {
t->sent_goaway_state = GRPC_CHTTP2_GRACEFUL_GOAWAY;
grpc_chttp2_goaway_append((1u << 31) - 1, 0, grpc_empty_slice(), &t->qbuf);
t->keepalive_timeout =
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

let's just add a comment over here


namespace grpc_core {

class Chttp2PingCallbacks {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

comments por favor

#include "src/core/lib/experiments/experiments.h"
#include "src/core/lib/gprpp/match.h"

/** How many pings do we allow to be inflight at any given time?
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

single line comments

@ctiller ctiller merged commit a17f08b into grpc:master Sep 28, 2023
@copybara-service copybara-service bot added the imported Specifies if the PR has been imported to the internal repository label Sep 28, 2023
ctiller added a commit to ctiller/grpc that referenced this pull request Oct 20, 2023
Isolate ping callback tracking to its own file.
Also takes the opportunity to simplify keepalive code by applying the
ping timeout to all pings.
Adds an experiment to allow multiple pings outstanding too (this was
originally an accidental behavior change of the work, but one that I
think may be useful going forward).

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bloat/low imported Specifies if the PR has been imported to the internal repository lang/c++ lang/core per-call-memory/neutral per-channel-memory/neutral release notes: no Indicates if PR should not be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants