-
Notifications
You must be signed in to change notification settings - Fork 2k
[#10877][fix] restore ipv6 support in serve.py #10929
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
base: main
Are you sure you want to change the base?
[#10877][fix] restore ipv6 support in serve.py #10929
Conversation
feel free to improve :-) Signed-off-by: Evgueni Petrov <evgueni.s.petrov@gmail.com>
📝 WalkthroughWalkthroughThe socket address family selection in the server initialization was changed from hard-coded IPv4 (AF_INET) to dynamic selection: AF_INET6 if the host contains a colon (IPv6 format), otherwise AF_INET. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tensorrt_llm/commands/serve.py (1)
1-1: Add NVIDIA copyright header for latest modification year.This file should include the standard NVIDIA header with the year of the latest meaningful modification. As per coding guidelines, please add the required header at the top of the file.
🧹 Nitpick comments (1)
tensorrt_llm/commands/serve.py (1)
189-190: Consider usingsocket.getaddrinfo()for more robust address family resolution.The colon-based heuristic won't handle IPv6-only DNS hostnames (e.g.,
ipv6-host.example.comthat resolve only to IPv6 addresses), which would be incorrectly classified as IPv4 and cause bind failures. Consider usingsocket.getaddrinfo(host, port, socket.AF_UNSPEC, socket.SOCK_STREAM)to properly resolve the address family, or implement a fallback retry mechanism that attempts AF_INET6 if the initial bind with AF_INET fails.
JunyiXu-nv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! LGTM
|
/bot run |
|
PR_Github #33269 [ run ] triggered by Bot. Commit: |
|
PR_Github #33269 [ run ] completed with state |
Use ipv6 address familty, if address family for host:port resolves to ipv6 only
This PR fixes #10877 introduced by #9646
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.