Skip to content

Add quic_expect_bug_impl.h, (spdy|http2)_logging_impl.h, (spdy|http2)_bug_tracker_impl.h QUICHE platform implementation#6339

Merged
htuch merged 7 commits intoenvoyproxy:masterfrom
wu-bin:h2_platform_logging_impl
Mar 26, 2019
Merged

Add quic_expect_bug_impl.h, (spdy|http2)_logging_impl.h, (spdy|http2)_bug_tracker_impl.h QUICHE platform implementation#6339
htuch merged 7 commits intoenvoyproxy:masterfrom
wu-bin:h2_platform_logging_impl

Conversation

@wu-bin
Copy link
Copy Markdown
Contributor

@wu-bin wu-bin commented Mar 21, 2019

Description:

Add quic_expect_bug_impl.h, (spdy|http2)_logging_impl.h, (spdy|http2)_bug_tracker_impl.h QUICHE platform implementation.

All of them depends on quic_logging_impl.h.

Risk Level: minimum, code not used yet.
Testing:

bazel test test/extensions/quic_listeners/quiche/platform:spdy_platform_test --test_output=all --define quiche=enabled
bazel test test/extensions/quic_listeners/quiche/platform:http2_platform_test --test_output=all --define quiche=enabled
bazel test test/extensions/quic_listeners/quiche/platform:quic_platform_test --test_output=all --define quiche=enabled
bazel test @com_googlesource_quiche//:spdy_platform_test --test_output=all --define quiche=enabled
bazel test @com_googlesource_quiche//:http2_platform_test --test_output=all --define quiche=enabled
bazel test @com_googlesource_quiche//:quic_platform_test --test_output=all --define quiche=enabled

Docs Changes: none
Release Notes: none
[Optional Fixes #Issue]
[Optional Deprecated:]

@wu-bin
Copy link
Copy Markdown
Contributor Author

wu-bin commented Mar 21, 2019

/assign @danzh2010

@wu-bin
Copy link
Copy Markdown
Contributor Author

wu-bin commented Mar 21, 2019

/retest

@repokitteh-read-only
Copy link
Copy Markdown

🔨 rebuilding ci/circleci: clang_tidy (failed build)
🔨 rebuilding ci/circleci: asan (failed build)
🔨 rebuilding ci/circleci: tsan (failed build)
🔨 rebuilding ci/circleci: coverage (failed build)

🐱

Caused by: a #6339 (comment) was created by @wu-bin.

see: more, trace.

name = "http2_platform",
hdrs = [
"quiche/http2/platform/api/http2_arraysize.h",
"quiche/http2/platform/api/http2_bug_tracker.h",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Q please: do these API files need to be wrapped in envoy_select_quiche if their impl's are wrapping with it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's not necessary but I moved some to envoy_select_quiche.

IIUC, this (and some other) library is not a "real" library - it does not have a "srcs" section, so "bazel build" this library "succeeds" without doing anything. But

  • if a dependency(like http2_platform_test) uses this library, that dependency will fail to build.
  • the library will fail to build as soon as we add a .cc to the "srcs" section.
    In my past PRs, I add envoy_select_quiche when 1) ci fails on the files I'm adding or 2) I think ci will fail on the files I'm adding. It is really a bandaid to allow us to continue working on platform impls before the root of the build problem is fixed.


envoy_cc_library(
name = "quic_platform_logging_impl_lib",
srcs = ["quic_logging_impl.cc"],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

does this need to be wrapped in envoy_select_quiche?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's not necessary, libraries depend on this is using envoy_select_quiche.


if (!(is_dfatal && g_dfatal_exit_disabled)) {
abort();
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you combine this if block with the #ifdef NDEBUG block above?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -26,6 +30,14 @@ TEST(SpdyPlatformTest, SpdyArraysize) {
EXPECT_EQ(5, SPDY_ARRAYSIZE(array));
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we move these tests under namespace spdy? ditto to Http2PlatformTest

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Move their namespaces SGTM, but it is unrelated to this PR, let's do it separately.

Copy link
Copy Markdown
Contributor

@danzh2010 danzh2010 left a comment

Choose a reason for hiding this comment

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

LGTM other than a request to add corresponding namespace to spdy|http2_platform_test.cc

danzh2010
danzh2010 previously approved these changes Mar 22, 2019
@wu-bin
Copy link
Copy Markdown
Contributor Author

wu-bin commented Mar 22, 2019

/assign @mattklein123 @alyssawilk @htuch

Copy link
Copy Markdown
Contributor

@alyssawilk alyssawilk left a comment

Choose a reason for hiding this comment

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

LGTM pending one question

#define QUIC_BUG_IF_IMPL(condition) QUIC_LOG_IF(DFATAL, condition)
#define QUIC_PEER_BUG_IMPL QUIC_LOG(ERROR)
#define QUIC_PEER_BUG_IF_IMPL(condition) QUIC_LOG_IF(ERROR, condition)
#define QUIC_BUG_IMPL QUIC_LOG_IMPL(DFATAL)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

preexisted, but doesn't QUIC_BUG work based on the exponential back-off, and could cause serious perf problems if we don't do that?
Should we get a TODO to get around to that work?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

QUIC_BUG has the exponential back off in google3 but not Chromium. It, like other error logs, could cause serious perf problems if it happens too frequently.

TODO added to implement exponential back off in envoy.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah, per-packet logging server side scales less well than client side :-) thanks for the TODO

Copy link
Copy Markdown
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

LGTM modulo comments.
/wait

SPDY_DLOG(INFO) << "DLOG(INFO)";
SPDY_DLOG(ERROR) << "DLOG(ERROR)";

SPDY_DLOG_IF(ERROR, true) << "DLOG_IF(ERROR, true)";
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.

Just as an FYI; when we do the Envoy-side QUIC implementation, we should avoid using any of these macros, ideally we restrict access to them using package visibility to just the QUICHE code and PAL.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ack, totally agree.

Copy link
Copy Markdown
Contributor Author

@wu-bin wu-bin left a comment

Choose a reason for hiding this comment

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

Thanks Alyssa and Harvey. I added a TODO for the exponential back off.

#define QUIC_BUG_IF_IMPL(condition) QUIC_LOG_IF(DFATAL, condition)
#define QUIC_PEER_BUG_IMPL QUIC_LOG(ERROR)
#define QUIC_PEER_BUG_IF_IMPL(condition) QUIC_LOG_IF(ERROR, condition)
#define QUIC_BUG_IMPL QUIC_LOG_IMPL(DFATAL)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

QUIC_BUG has the exponential back off in google3 but not Chromium. It, like other error logs, could cause serious perf problems if it happens too frequently.

TODO added to implement exponential back off in envoy.

SPDY_DLOG(INFO) << "DLOG(INFO)";
SPDY_DLOG(ERROR) << "DLOG(ERROR)";

SPDY_DLOG_IF(ERROR, true) << "DLOG_IF(ERROR, true)";
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ack, totally agree.

Copy link
Copy Markdown
Contributor

@alyssawilk alyssawilk left a comment

Choose a reason for hiding this comment

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

LGTM - I'll let Harvey sign off on his requests and merge.

#define QUIC_BUG_IF_IMPL(condition) QUIC_LOG_IF(DFATAL, condition)
#define QUIC_PEER_BUG_IMPL QUIC_LOG(ERROR)
#define QUIC_PEER_BUG_IF_IMPL(condition) QUIC_LOG_IF(ERROR, condition)
#define QUIC_BUG_IMPL QUIC_LOG_IMPL(DFATAL)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah, per-packet logging server side scales less well than client side :-) thanks for the TODO

Copy link
Copy Markdown
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Thanks!

@htuch htuch merged commit 8fb00ba into envoyproxy:master Mar 26, 2019
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.

5 participants