V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
frank1256
V2EX  ›  程序员

spring rest template 在 kubernetes time out

  •  
  •   frank1256 · 2022-07-22 15:20:50 +08:00 · 904 次点击
    这是一个创建于 615 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

    3 条回复    2022-07-22 16:42:45 +08:00
    chendy
        1
    chendy  
       2022-07-22 15:38:39 +08:00
    开 debug 日志,看看发了啥请求,卡在哪一步
    frank1256
        2
    frank1256  
    OP
       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
        3
    issakchill  
       2022-07-22 16:42:45 +08:00
    换个 http client 先试试效果?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3340 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 13:26 · PVG 21:26 · LAX 06:26 · JFK 09:26
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.