• 请不要在回答技术问题时复制粘贴 AI 生成的内容
frank1256
V2EX  ›  程序员

spring rest template 在 kubernetes time out

  •  
  •   frank1256 · Jul 22, 2022 · 1418 views
    This topic created in 1403 days ago, the information mentioned may be changed or developed.

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

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

    3 replies    2022-07-22 16:42:45 +08:00
    chendy
        1
    chendy  
       Jul 22, 2022
    开 debug 日志,看看发了啥请求,卡在哪一步
    frank1256
        2
    frank1256  
    OP
       Jul 22, 2022
    @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  
       Jul 22, 2022
    换个 http client 先试试效果?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5217 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 97ms · UTC 01:13 · PVG 09:13 · LAX 18:13 · JFK 21:13
    ♥ Do have faith in what you're doing.