spring rest template 在 kubernetes time out

2022-07-22 15:20:50 +08:00
 frank1256

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

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

916 次点击
所在节点    程序员
3 条回复
chendy
2022-07-22 15:38:39 +08:00
开 debug 日志,看看发了啥请求,卡在哪一步
frank1256
2022-07-22 15:47:03 +08:00
@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
2022-07-22 16:42:45 +08:00
换个 http client 先试试效果?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/868022

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX