frank1256
V2EX  ›  程序员

spring rest template 在 kubernetes time out

By frank1256 at 2022 年 7 月 22 日 · 1680 次点击

遇到个怪事,我进到在 K8s 里的 pod ,已经 curl 可以访问了。但是代码里直接 timeout 。什么鬼。

有大佬遇到过类似的吗,毫无头绪

3 条回复  •  2022-07-22 16:42:45 +08:00
chendy
   1
chendy  
   2022 年 7 月 22 日
开 debug 日志,看看发了啥请求,卡在哪一步
frank1256
   2
frank1256  
OP
   2022 年 7 月 22 日
@chendy 请求已经抓出来了"I/O error on GET request for \"http://178.104.163.72:31300/users/list\": Read timed out; nested exception is java.net.SocketTimeoutException: Read timed out",
我直接在容器里 curl http://178.104.163.72:31300/users/list 是能访问的
issakchill
   3
issakchill  
   2022 年 7 月 22 日
换个 http client 先试试效果?
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
© 2026 V2EX · 32ms · 3.9.8.5