日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

jenkinsapi出现HTTPConnectionPool Max retires exceeded异常

發布時間:2024/9/21 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 jenkinsapi出现HTTPConnectionPool Max retires exceeded异常 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

python項目通過使用jenkinsapi遠程控制jenkins

jenkinsapi使用的遠程連接方法是requests包,requests包又使用了urllib3,urllib3又引用了httplib。

"""
urllib3 - Thread-safe connection pooling and re-using.
"""

requests使用連接池機制,連接池

http的通過設置

Connection:keep-alive

的header頭來表明是長連接,通過傳輸層tcp的長連接實現

短連接會占用較多的端口

socket就是源IP、源端口、協議(scheme)、目的IP、目的端口的五元組

?

import requests sess = requests.Session() adapter = requests.adapters.HTTPAdapter(pool_connections=100, pool_maxsize=100) sess.mount('http://', adapter) resp = sess.get("/mypage")


requests常見的一些錯誤提示有:
  • Failed to establish a new connection:
  • Connection pool is full, discarding connection

The newest version of Requests does in fact keep the TCP connection alive after your request.. If you do want your TCP connections to close, you can just configure the requests to not use?keep-alive.

s = requests.session() s.config['keep_alive'] = False
s.keep_alive = False

requests的默認連接池是10個,每個連接池的最大連接數默認也是10個

?

https://segmentfault.com/q/1010000000517234

https://www.kawabangga.com/posts/2740

http://blog.oldboyedu.com/tcp-wait/

http://blog.csdn.net/hetaohappy/article/details/51851880

http://www.cnblogs.com/0201zcr/p/4694945.html

http://codewenda.com/%E6%88%91%E5%8F%AF%E4%BB%A5%E6%9B%B4%E6%94%B9python%E7%9A%84%E8%AF%B7%E6%B1%82%E6%A8%A1%E5%9D%97%E7%9A%84%E8%BF%9E%E6%8E%A5%E6%B1%A0%E5%A4%A7%E5%B0%8F%E5%90%97%EF%BC%9F/

http://docs.python-requests.org/zh_CN/latest/user/advanced.html

https://www.villainhr.com/page/2016/07/23/python%E4%B8%AD%E7%9A%84requests

https://www.villainhr.com/page/2016/07/23/python%E4%B8%AD%E7%9A%84requests

http://blog.csdn.net/hzrandd/article/details/74463313

與50位技術專家面對面20年技術見證,附贈技術全景圖

總結

以上是生活随笔為你收集整理的jenkinsapi出现HTTPConnectionPool Max retires exceeded异常的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。