second-state / microservice-rust-mysql

A template project for building a database-driven microservice in Rust and run it in the WasmEdge sandbox.
Apache License 2.0
345 stars 53 forks source link

Set the nameserver to 127.0.0.11:53 for wasmedge_wasi_socket 0.5.0 #18

Closed hydai closed 1 year ago

juntao commented 1 year ago

Hello, I am a code review bot on flows.network. Here are my reviews of code commits in this PR.


Commit 7d23faf8967ab5ab9944d00f83811ee6efd544ad

Summary of key changes:

Potential problems:

Note: The provided patch only includes changes to docker-compose.yml and does not show the complete context of the code changes.

juntao commented 1 year ago

This DNS_SERVER is not read by the Rust code. It is a built-in feature for WasmEdge socket? The socket library automatically uses it for DNS if it is set?

juntao commented 1 year ago

And also why 127.0.0.11? It is a special value defined by Docker Compose?

hydai commented 1 year ago

This DNS_SERVER is not read by the Rust code. It is a built-in feature for WasmEdge socket? The socket library automatically uses it for DNS if it is set?

Please refer to https://github.com/second-state/wasmedge_wasi_socket/pull/84/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R372

The built-in-dns feature in wasmedge_wasi_socket will try to use 8.8.8.8:53 if the DNS_SERVER is not set. However, docker-compose uses 127.0.0.11:53 as the nameserver.

Since we already bumped the tokio_wasi and hyper_wasi to use the built-in-dns, this is the workaround for making it use the correct DNS nameserver unless we release new releases by turning off the built-in-dns feature.

juntao commented 1 year ago

Ok. We should probably turn it on only if the DNS_SERVER is set.

I will merge this now.