Commit Graph

182 Commits

Author SHA1 Message Date
AJ Heller 1a8b22f2de [build] Restrict visibility for creating core credentials types. (#36216)
Closes #36216

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36216 from drfloob:conceal-core-cred-creation a44a299273
PiperOrigin-RevId: 625425746
2024-04-17 01:21:29 +00:00
Craig Tiller b0cf42d86e [clang-format] Remove requirement that port_platform.h is at the top (#36281)
Closes #36281

PiperOrigin-RevId: 623176865
2024-04-09 08:58:34 -07:00
Mark D. Roth 10e83973e7 [reorg] move resolver code to src/core/resolver (#35804)
This new directory combines code from the following locations:
- src/core/ext/filters/client_channel/resolver
- src/core/lib/resolver

Closes #35804

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35804 from markdroth:client_channel_resolver_reorg2 30660e6b00
PiperOrigin-RevId: 604665835
2024-02-06 09:07:56 -08:00
AJ Heller 2288b63601 [EventEngine] Fix HttpCli test to deail with EventEngine async execution (#35776)
One test (`CallerPollentsAreNotReferencedAfterCallbackIsRan`) was not waiting for a callback to be run before finishing when the EventEngine client is in use. With the iomgr implementation, `exec_ctx.Flush();` previously guaranteed that the callback would be executed before the test ended, but the EventEngine runs it in a separate thread, with the EventEngine shim providing its own isolated ExecCtx. This fix simply waits for the callback to be run before exiting, in the same way many other tests in this file wait on iomgr-based callback execution.

Closes #35776

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35776 from drfloob:httpcli-test-async 3c920da741
PiperOrigin-RevId: 603175531
2024-01-31 15:23:24 -08:00
apolcyn 7d5b53e2a7 [testing] minor logging improvement in http cli tests (#35654)
as title

Closes #35654

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35654 from apolcyn:fix_logs eb1fbcd7a5
PiperOrigin-RevId: 601198258
2024-01-24 12:26:44 -08:00
Yijie Ma bae0c705aa
[Deps] Update to Clang-16 (#34492)
<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->
2023-10-11 16:26:32 -07:00
Mario Jones Vimal 1c0f5d32a0
[core/gpr] Move subprocess to gpr and add subprocess creation using execve (#33983)
Move subprocess util to gpr.
Add support for communication with the subprocess.
This is required to support authentication using an executable.
2023-08-07 12:53:00 -07:00
Craig Tiller 5325b65d84
Revert "[core/gpr] move subprocess to gpr" (#33972)
Reverts grpc/grpc#33870 - since it breaks memory usage tooling.
2023-08-02 20:40:12 -07:00
Mario Jones Vimal f10a8e3418
[core/gpr] move subprocess to gpr (#33870)
Move subprocess util to gpr.
Add support for communication with the subprocess.
This is required to support authentication using an executable.
2023-08-02 13:19:08 -07:00
Craig Tiller 3717ff04ba
[chttp2] Split ping policy from transport (#33703)
Why: Cleanup for chttp2_transport ahead of promise conversion - lots of
logic has become interleaved throughout chttp2, so some effort to
isolate logic out is warranted ahead of that conversion.

What: Split configuration and policy tracking for each of ping rate
throttling and abuse detection into their own modules. Add tests for
them.

Incidentally: Split channel args into their own header so that we can
split the policy stuff into separate build targets.

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-07-26 09:19:35 -07:00
Yijie Ma a7bf07e86a
[EventEngine] PosixEventEngine DNS Resolver (#32701)
This PR implements a c-ares based DNS resolver for EventEngine with the
reference from the original
[grpc_ares_wrapper.h](../blob/master/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h).
The PosixEventEngine DNSResolver is implemented on top of that. Tests
which use the client channel resolver API
([resolver.h](../blob/master/src/core/lib/resolver/resolver.h#L54)) are
ported, namely the
[resolver_component_test.cc](../blob/master/test/cpp/naming/resolver_component_test.cc)
and the
[cancel_ares_query_test.cc](../blob/master/test/cpp/naming/cancel_ares_query_test.cc).
The WindowsEventEngine DNSResolver will use the same EventEngine's
grpc_ares_wrapper and will be worked on next.

The
[resolve_address_test.cc](https://github.com/grpc/grpc/blob/master/test/core/iomgr/resolve_address_test.cc)
which uses the iomgr
[DNSResolver](../blob/master/src/core/lib/iomgr/resolve_address.h#L44)
API has been ported to EventEngine's dns_test.cc. That leaves only 2
tests which use iomgr's API, notably the
[dns_resolver_cooldown_test.cc](../blob/master/test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc)
and the
[goaway_server_test.cc](../blob/master/test/core/end2end/goaway_server_test.cc)
which probably need to be restructured to use EventEngine DNSResolver
(for one thing they override the original grpc_ares_wrapper's free
functions). I will try to tackle these in the next step.
<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->
2023-07-21 13:24:16 -07:00
Ben Beasley 011e1162c2
[Test] Use `ssl.SSLContext.wrap_socket`, not `ssl.wrap_socket` (#33492)
In the HTTP(S) test server in the core tests, use
`ssl.SSLContext.wrap_socket`, not `ssl.wrap_socket`. The latter emits a
`DeprecationWarning` since Python 3.10 and is [removed in Python
3.12](https://github.com/python/cpython/issues/94199).

This fixes the core tests (but not necessarily the `grpcio` tests) for
Python 3.12.

This is relevant to https://github.com/grpc/grpc/issues/33063.
2023-06-21 10:06:08 -07:00
Sergii Tkachenko de6ed9ba9f
[Python] Migrate from yapf to black (#33138)
- Switched  from yapf to black
- Reconfigure isort for black
- Resolve black/pylint idiosyncrasies 

Note: I used `--experimental-string-processing` because black was
producing "implicit string concatenation", similar to what described
here: https://github.com/psf/black/issues/1837. While currently this
feature is experimental, it will be enabled by default:
https://github.com/psf/black/issues/2188. After running black with the
new string processing so that the generated code merges these `"hello" "
world"` strings concatenations, then I removed
`--experimental-string-processing` for stability, and regenerated the
code again.

To the reviewer: don't even try to open "Files Changed" tab 😄 It's
better to review commit-by-commit, and ignore `run black and isort`.
2023-06-09 15:08:55 -07:00
Craig Tiller 175ccc3a90
Reland global config changes (#32661)
<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-03-27 18:55:24 -07:00
Jan Tattermusch 0c1797cd9f
Revert "[config] Move global config alongside core configuration" (#32659)
Reverts grpc/grpc#30788

(it breaks grpc_objc_bazel_test (see
https://github.com/grpc/grpc/pull/30788#issuecomment-1476372187) and
also seems to be breaking some other internal stuff).
2023-03-20 08:22:29 -07:00
Craig Tiller b7a83305e6
[config] Move global config alongside core configuration (#30788)
This is a big rewrite of global config.

It does a few things, all somewhat intertwined:
1. centralize the list of configuration we have to a yaml file that can
be parsed, and code generated from it
2. add an initialization and a reset stage so that config vars can be
centrally accessed very quickly without the need for caching them
3. makes the syntax more C++ like (less macros!)
4. (optionally) adds absl flags to the OSS build

This first round of changes is intended to keep the system where it is
without major changes. We pick up absl flags to match internal code and
remove one point of deviation - but importantly continue to read from
the environment variables. In doing so we don't force absl flags on our
customers - it's possible to configure grpc without the flags - but
instead allow users that do use absl flags to configure grpc using that
mechanism. Importantly this lets internal customers configure grpc the
same everywhere.

Future changes along this path will be two-fold:
1. Move documentation generation into the code generation step, so that
within the source of truth yaml file we can find all documentation and
data about a configuration knob - eliminating the chance of forgetting
to document something in all the right places.
2. Provide fuzzing over configurations. Currently most config variables
get stashed in static constants across the codebase. To fuzz over these
we'd need a way to reset those cached values between fuzzing rounds,
something that is terrifically difficult right now, but with these
changes should simply be a reset on `ConfigVars`.

<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-03-17 16:56:45 -07:00
Esun Kim 905df9dee6
Update Abseil to 20230125 (#32139)
* Update abseil to 1.20230125.0

* Fix IWYU
2023-01-30 16:20:24 -08:00
Yijie Ma f99b8b5bc4
Convert c-style comments to C++-style comments (#31923)
* baseline

* fix clang-tidy

* manually revert these files

* manually fixup at eof

* revert 2 more files

* change check_deprecated_grpc++.py

* change end2end_defs.include template

* fix check_include_guards.py

* untrack tools/distrib/python/convert_cstyle_comments_to_cpp.py

not yet ready to be submitted

* fix

yapf check_include_guards.py
remove a space...

* fix version.cc.template

* fix version_info.h.template
2022-12-22 23:01:53 -08:00
Craig Tiller 49a3035d44
[iwyu] Fix CI job (#31921)
* fix-includes

* fix

* fix

* fix

* fix

* fix

* Automated change: Fix sanity tests

* add warning label

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-12-19 08:18:39 -08:00
Cheng-Yu Chung 77b3972f95
Clean up the TODO item in build target `grpc_base` part `channel_args` (#31642)
* Clean up the TODO item in build target `grpc_base` part `channel_args`

* Update

* Update

* Update

* Automated change: Fix sanity tests

* update

* Automated change: Fix sanity tests
2022-11-23 16:01:34 -05:00
Cheng-Yu Chung 7e3ada34e6
Clean up the TODO item in build target `grpc_base` -- part `closure` (#31001)
* Clean up the TODO item in build target `grpc_base` part `closure`

* Update

* Update

* Revert "Update"

This reverts commit daf3118390.

* Update

* Update

* Automated change: Fix sanity tests
2022-11-18 18:35:22 -05:00
Cheng-Yu Chung 3ef817b3bf
Clean up the TODO item in build target `grpc_base` -- part `slice` (#31003)
* Clean up the TODO item in build target `grpc_base` part `slice`

* Automated change: Fix sanity tests
2022-11-15 13:47:27 -05:00
Esun Kim 85794d4094
Deprecated grpc_error_std_string (#31267) 2022-10-07 10:16:18 -07:00
Esun Kim 4bd27c524a
More changes (#31194) 2022-09-30 17:10:01 -07:00
Craig Tiller 8174a75079
[iwyu] Add more test directories (#30952)
* [iwyu] Add more test directories

* fix

* fix

* fix

* fix

* fix

* Automated change: Fix sanity tests

* fix

* iwyu

* Automated change: Fix sanity tests

* fix

* fix

* fix

* fix

* Automated change: Fix sanity tests

* fix

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-09-29 06:47:07 -07:00
Esun Kim d43511f4af
Removed GRPC_ERROR_NONE (#31131) 2022-09-27 23:17:39 -07:00
Esun Kim ba8af0157b
Removing GRPC_ERROR_[REF|UNREF|IS_NONE] (#31089)
* Removing GRPC_ERROR_[REF|UNREF|IS_NONE]

* Clean up unnecessary error

* Fix

* Fix2

* Remove unnecessary else
2022-09-26 15:41:12 -07:00
Craig Tiller c2ab8c99bb
Revert "Revert "[c++] Move environment functions to C++ (#30937)" (#30986)" (#30988)
This reverts commit 96264e07b8.
2022-09-14 14:19:36 -07:00
Craig Tiller 96264e07b8
Revert "[c++] Move environment functions to C++ (#30937)" (#30986)
This reverts commit 74c0d6fe3f.
2022-09-14 11:53:55 -07:00
Craig Tiller 74c0d6fe3f
[c++] Move environment functions to C++ (#30937)
* [gprpp] Move env to C++

* move headers/impl

* Automated change: Fix sanity tests

* fix

* fix

* Automated change: Fix sanity tests

* Update http_proxy.cc

* fix

* fix

* rename

* fix merge

* fix

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-09-14 10:17:15 -07:00
Craig Tiller b463cabeec
Update flaky tests (#30873)
* Update flaky tests list

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-09-07 10:16:34 -07:00
Craig Tiller 5a5ff826cf
[fixit] Scale down large tests (#30685)
We have many tests that create 100 threads or more, and mounting evidence that
this is harmful to our CI environment.

When the original code for many of these tests was written we ran our tests
under run_tests, which had explicit handling for tracking the number of threads
each test needed and making sure that we weren't over subscribing the test
runner. Bazel has no such facility (and the facility in run_tests has since
been removed) and so we need to adjust.

This PR adjusts down a single test and is part of a series so that we can
review and roll back easily if required.
2022-08-22 16:34:16 -07:00
Craig Tiller f573fd44f9
[test] Semi-automatic flaky test tracking (#30638)
* [test] Semi-automatic flaky test tracking

* fix

* Automated change: Fix sanity tests

* Update update_flakes.py

* fix formatting

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-08-19 16:22:31 -07:00
Craig Tiller 05e6bf2e4a
[build] Add test/core/util, test/core/event_engine to auto build deps (#30364)
* [build] Add test/core/util, test/core/event_engine to auto build deps

* deal with suppressions

* fix suppressions

* Automated change: Fix sanity tests

* fix

* fix

* fix

* fix

* progress

* Automated change: Fix sanity tests

* fix

* fix

* fix

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-07-25 21:59:25 -07:00
Esun Kim 34b380697d
gtestify test/core/http (#30200)
* Fix

* gtestify test/core/http

* Fix

* fix
2022-07-14 11:02:16 -07:00
Craig Tiller 6532084a06
[iwyu] rest of the owl: src/core/lib - excluding iomgr, gpr (#29735)
* [iwyu] rest of the owl: src/core/lib - excluding iomgr, gpr

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

* fixes

* Automated change: Fix sanity tests

* fix

* fix

* fixes

* fixes

* x

* fix?

* fix

* windows fix

* fix

* fix

* fix

* fix

* fix

* debug

* fix

* fix

* Revert "debug"

This reverts commit c99b8d12dd.

* Automated change: Fix sanity tests

* fix?

* Automated change: Fix sanity tests

* header cleanup

* fix

* fix

* fix

* Automated change: Fix sanity tests

* fix

* fix

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

* fixes

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-06-10 13:04:47 -07:00
Esun Kim c6ebbb5482
Added GRPC_ERROR_IS_NONE (#29937)
* Added GRPC_ERROR_IS_NONE

* Convert

* Fix
2022-06-08 11:24:20 -07:00
Craig Tiller 5918f98ecb
[iwyu] Enable nosafe_headers (#29591)
* Add flag

* sweep1

* fixes

* speedup

* fixes

* fix

* fix

* fix

* Automated change: Fix sanity tests

* fix

* fix

* fix

* fix

* fix

* fix

* fix

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-05-06 11:31:11 -07:00
Craig Tiller 6b00bc7516
[build] Remove str_format.h from server_address.h (#29524)
This file gets included by resolver, which gets included by
core_configuration, which in turn sprays this inclusion everywhere (and
it's a costly file to parse)
2022-04-29 10:55:10 -07:00
Nicolas Noble b35605d1da
Adding http/1.1 support in httpcli. (#29238)
* Basic HTTP/1.1 header.

* Fixing format_request_test.

* Adding chunked tests.

* Chunked parser for HTTP/1.1 response.
2022-03-31 09:55:43 -07:00
AJ Heller 18a8f6aad9
Refactor end2end tests to exercise each EventEngine (#29202)
* Refactor end2end tests to exercise each EventEngine

* fix incorrect bazel_only exclusions

* Automated change: Fix sanity tests

* microbenchmark fix

* sanitize, fix iOS flub

* Automated change: Fix sanity tests

* iOS fix

* reviewer feedback

* first pass at excluding EventEngine test expansion

Also caught a few cases where we should not test pollers, but should
test all engines. And two cases where we likely shouldn't be testing
either product.

* end2end fuzzers to be fuzzed differently via EventEngine.

* sanitize

* reviewer feedback

* remove misleading comment

* reviewer feedback: comments

* EE test_init needs to play with our build system

* fix golden file test runner

Co-authored-by: drfloob <drfloob@users.noreply.github.com>
2022-03-30 15:43:05 -07:00
apolcyn 20521fb33e
Fix memory leak in HTTP request security handshake cancellation (#28971)
* Fix memory leak in HTTP request security handshake cancellation
2022-03-01 14:43:35 -08:00
Craig Tiller 5fc3ff8203
grpc_millis -> Timestamp/Duration (#28119)
* wip

* Automated change: Fix sanity tests

* fixes

* progress

* progress

* grpc compiles

* Automated change: Fix sanity tests

* fixing tests

* x

* progress

* better code

* Automated change: Fix sanity tests

* progress

* progress

* windows fix

* Make Duration metadata trivial

* better message

* fix

* Automated change: Fix sanity tests

* fix

* fix

* fix

* fix

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

* fix

* progress

* fixes

* fix

* fix

* spam

* un-disable errantly disabled tests

* gain insight

* Automated change: Fix sanity tests

* fixes

* fixes

* fix

* debug

* tweak

* fix

* fix timeout

* fix comment

* fixes

* x

* better test

* tests

* Automated change: Fix sanity tests

* missed file

* fix

* x

* fix

* fix

* fix

* fix

* Automated change: Fix sanity tests

* fix

* merge

* Automated change: Fix sanity tests

* fix

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-03-01 11:34:05 -08:00
apolcyn 6bf8e22484
Add http cancel api (#28354)
Add an API to cancel HTTP1 requests
2022-01-25 10:37:05 -08:00
apolcyn 066a50b9ca
Remove grpc_httpcli_context (#27867)
* remove grpc_httpcli_context
2022-01-11 11:28:53 -08:00
Jan Tattermusch e0b3582701
Fix portability (#28284)
* Add python3 to list of acceptable pythons in python wrapper

* Attempt to make fake server python3 compatible

* py3 fixes for test server

* more py3 fixes for test server

* require python3 for test/core/http/test_server.py

Co-authored-by: Alexander Polcyn <apolcyn@google.com>
2021-12-08 05:46:42 +01:00
Craig Tiller a629c9a03e
Reland resource quota work (#28017)
* Check if memory owner available prior to polling it

The transport may drop the memory owner during its destruction sequence

* tcp_fix

* Revert "Revert "New resource quota integration (#27643)" (#28014)"

This reverts commit 0ea2c37263.

* clang-format

* fix-path

* fix
2021-11-15 08:23:51 -08:00
Craig Tiller 0ea2c37263
Revert "New resource quota integration (#27643)" (#28014)
This reverts commit 39f0877d25.
2021-11-11 14:26:19 -08:00
Craig Tiller 39f0877d25
New resource quota integration (#27643)
* new resource quota integration

* Automated change: Fix sanity tests

* fix

* fix

* fixes

* fixes

* fixes

* Automated change: Fix sanity tests

* fixes

* fixes

* Automated change: Fix sanity tests

* fixes

* fix

* fixes

* windows-fix

* fixes

* fixes

* fix

* fix-asan

* banned

* banned

* fixes

* clang-tidy-fix

* Automated change: Fix sanity tests

* fix-cronet

* review feedback

* review feedback

* Automated change: Fix sanity tests

* fixes

* bug fix

* fixes

* compile fix

* exclude megabyte size payloads from 1byte tests

* windows fix

* start moving ios

* keep moving windows

* Get windows compilation working.

* Automated change: Fix sanity tests

* better

* fixes

* remove slice buffer from memory_allocator.h

* Revert "remove slice buffer from memory_allocator.h"

This reverts commit 234a63b6e3.

* ugh

* #fixtests

* pthread tls fixes

* Automated change: Fix sanity tests

* fixfixfix

* xxx

* add reset

* review feedback

* fix

* fix

* fixes

* fix

* mac progress

* cpp-impl-of

* rename ptr

* Automated change: Fix sanity tests

* memory-owner-is-a-memory-allocator

* fixes

* fix

* fix from prod

* fix

* Fix issue leading to bad pointers being returned on Windows.

* Automated change: Fix sanity tests

* fix multislice bug

* argh

* hyrums law fixes

* hyrums law fixes

* clang-format

* hyrums law fixes

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2021-11-10 22:53:04 -08:00
Richard Belleville 468768865b
Make Buildifier Sanity Test Strict (#27807)
* Fix all lint errors in repo.

* Use strict buildifier by default

* Whoops. That file does not exist

* Attempt fix to buildifier invocation

* Add missing copyright
2021-11-03 14:57:04 -07:00