Skip to content
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

fix: init dns resolvers in stream subsystem #4186

Merged
merged 2 commits into from
May 6, 2021

Conversation

tokers
Copy link
Contributor

@tokers tokers commented May 6, 2021

What this PR does / why we need it:

Since f914807, the connect of tcpsock was patched by using our own DNS
resolvers. It relies on a dns_resolvers variable which should be
initialized in init_by_lua* phase, however, the initialization step in
stream sub-system is missed so once users enable the stream proxy and
the tcpsock:connect is invoked with a non-IP host, Lua runtime errors
will be thrown.

This PR fixed this issue by initializing the DNS resolvers in the stream
sub-subsystem.

Examples

If we use the ETCD FQDN, we may see the following errors continuously.

image

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

Since f914807, the connect of tcpsock was patched by using our own DNS
resolvers. It relies on a dns_resolvers variable which should be
initialized in init_by_lua* phase, however, the initialization step in
stream sub-system is missed so once users enable the stream proxy and
the tcpsock:connect is invoked with a non-IP host, Lua runtime errors
will be thrown.

This PR fixed this issue by initializing the DNS resolvers in the stream
sub-subsystem.
@tokers tokers requested review from spacewander and membphis May 6, 2021 06:24
@tokers tokers added the bug Something isn't working label May 6, 2021
@tokers tokers added this to the 2.6 milestone May 6, 2021
@spacewander spacewander changed the title fix: init dns resolvers in stream subsystem. fix: init dns resolvers in stream subsystem May 6, 2021
@spacewander spacewander merged commit f7460ee into apache:master May 6, 2021
@tokers tokers deleted the fix/init-dns-resolvers-in-stream branch May 6, 2021 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants