Commit Graph

14 Commits

Author SHA1 Message Date
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
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
Cheng-Yu Chung 384982ba2b [bugfixes] Fix vulnerability for PyYAML (#32007)
* Fix vulnerability for PyYAML

* Fix

* Revert "Fix"

This reverts commit 5522d226c46e8bd7ace2da35c377f34e66df7f9c.

* Fix

* Fix format
2023-01-04 12:33:29 +08:00
Lidi Zheng 2231c2ba77 Introduce Python import sorting to our sanity test suite (#26768)
* Add isort_code.sh to sanity tests

* Run tools/distrib/isort_code.sh

* Fine tune the import order for relative imports

* Make pylint and project generation happy

* Fix a few corner cases

* Use --check instead of --diff

* The import order impacts test result somehow

* Make isort print diff and check output at the same time

* Let tools/run_tests/python_utils be firstparty library

* Run isort against latest HEAD
2021-07-26 12:31:21 -07:00
Alexander Polcyn 9480039754 Fix formatting 2020-12-16 11:00:51 -08:00
Alexander Polcyn aef3bb0157 Remove unnecessary explicit bytes conversion 2020-12-16 10:17:17 -08:00
Alexander Polcyn 408a02379d Make c-ares resolver unit tests runnable under python3 2020-12-15 23:51:19 -08:00
Esun Kim e52081f903 More pythons to be formatted 2020-01-03 22:21:23 -08:00
Alex Polcyn e52d87b53d Add a grpclb-in-DNS interop test suite 2018-10-23 00:00:08 -07:00
Alexander Polcyn 50a7213929 Revert "Fix c-ares tests ipv6-only brokenness"
This reverts commit 27718ce64d.
2018-06-11 11:35:32 -07:00
Alexander Polcyn 27718ce64d Fix c-ares tests ipv6-only brokenness 2018-06-06 13:55:13 -07:00
Alexander Polcyn 6f8f914f8d cleanup, and get rid of unnecessary timeouts in two places 2018-05-01 20:52:57 -07:00
Alexander Polcyn 29fead7d49 Convert c-ares test runner from bash to python, so that it works on
windows
2018-04-24 16:24:43 -07:00
Alexander Polcyn 0a05b782fe Move python DNS utilities to utils subdirectory 2018-03-06 19:22:34 -08:00