[Minor fix] The domain dns.google may cause a socket.gaierror exception #3176
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
May Fix #3170
In specific network environments, the following code may throw a socket.gaierror exception because the domain dns.google cannot be resolved correctly to an IP address. The issue can be solved by directly using 8.8.8.8, even if 8.8.8.8:80 is not accessible.
File "/usr/local/lib/python3.10/dist-packages/vllm/entrypoints/llm.py", line 109, in init
self.llm_engine = LLMEngine.from_engine_args(engine_args)
File "/usr/local/lib/python3.10/dist-packages/vllm/engine/llm_engine.py", line 391, in from_engine_args
engine = cls(*engine_configs,
File "/usr/local/lib/python3.10/dist-packages/vllm/engine/llm_engine.py", line 128, in init
self._init_workers()
File "/usr/local/lib/python3.10/dist-packages/vllm/engine/llm_engine.py", line 167, in _init_workers
get_ip(), get_open_port())
File "/usr/local/lib/python3.10/dist-packages/vllm/utils.py", line 181, in get_ip
s.connect(("dns.google", 80))
socket.gaierror: [Errno -2] Name or service not known