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

jenkinsapi出现HTTPConnectionPool Max retires exceeded异常相关推荐

  1. Python requests 多线程抓取 出现HTTPConnectionPool Max retires exceeded异常

    Python requests 多线程抓取 出现HTTPConnectionPool Max retires exceeded异常 参考文章: (1)Python requests 多线程抓取 出现H ...

  2. HTTPConnectionPool Max retries exceeded with url

    ConnectionError at /data/booking/hanyue/xiaohongshu HTTPConnectionPool(http://): Max retries exceede ...

  3. HTTPConnectionPool(host:XX)Max retries exceeded with url 解决方法

    2019独角兽企业重金招聘Python工程师标准>>> HTTPConnectionPool(host:XX)Max retries exceeded with url 解决方法 在 ...

  4. python HTTPConnectionPool(host:XX)Max retries exceeded with url

    python 出现HTTPConnectionPool(host:XX)Max retries exceeded with url问题 在每次数据传输前客户端要和服务器建立TCP连接,为节省传输消耗, ...

  5. HTTPConnectionPool(host=‘localhost‘, port=28333): Max retries exceeded with url: /events (Caused by

    错误: 训练神经网络的时候报错如下: HTTPConnectionPool(host='localhost', port=28333): Max retries exceeded with url: ...

  6. HDFS读取问题:HTTPConnectionPool(host=, port=50075): Max retries exceeded

    在使用python读写HDFS时,遇到以下问题: ConnectionError: HTTPConnectionPool(host='node1.******.com', port=50075): M ...

  7. python requests max retries_python requests报Max retries exceeded with url异常

    项目中有个模块是定时获取设备状态的,通过设备的http请求访问获取返回的状态码,然后根据状态码检测设备是否在线.但是最近发现连接后出现了偶尔连接不上的情况,报错如下: 2018-06-14 15:51 ...

  8. 【爬虫 | Python】解决‘Requests Max Retries Exceeded With Url‘报错的问题

    [爬虫 | Python]解决'Requests Max Retries Exceeded With Url in Python'报错的问题 背景 解决方案 一.普遍方案 细致方案 一.问题重述 1. ...

  9. python3 错误 Max retries exceeded with url 解决方法

    在爬取时出现这种错误, ConnectionError: HTTPConnectionPool(host='xxx.xx.xxx.xxx', port=xxxx): Max retries excee ...

最新文章

  1. linux pam 解锁_linux中pam模块
  2. 【C 语言】字符串拷贝 ( 指针使用前判空 | while 空语句 )
  3. android 中国通信乱码问题
  4. 用PHPcms V9四步完成WAP手机站搭建
  5. 调用函数,求a+aa+aaa+....+aa...aa(n个a)
  6. 八位技术专家分享他们最喜欢的物联网技术
  7. 电信移动联通广电喜提5G牌照,5G手机明年爆发
  8. 读文件到十六进制的函数(Delphi 7 下可用) - 回复 峰哥!!! 的问题
  9. 桌面支持--WIN7任务栏上EXCEL的图标右键菜单上没有了最近打开的文档目录
  10. 金狐超级软件盘 07.14更新
  11. 学好单片机编程设计的方法和3个步骤
  12. int转byte数组以及相关原理
  13. compositionAPI
  14. 前端性能优化(四)——网页加载更快的N种方式
  15. 128兆内存能运行的linux,128兆内存能干嘛?
  16. 仿微信朋友圈拍照上传
  17. python 期货现货差价监测_期货现货价差小工具——天勤量化(TqSdk)
  18. 一文彻底弄懂工厂模式(Factory)
  19. JVM 垃圾回收(GC)
  20. 8.3 开始使用truffle-contract

热门文章

  1. GDCM:处理(各种操作处理)DICOM图像文件的测试程序
  2. GDCM:dicom文件的临床试验注释的测试程序
  3. GDCM:重写ELSCINT1 / PMSCT_RGB1压缩图像的测试程序
  4. Boost:bind的noexcept成员函数的type <>语法的测试程序
  5. 基于Boost::beast模块的异步HTTP客户端
  6. OpenCV提炼角点位置的实例(附完整代码)
  7. Clojure开发OpenCV的简介
  8. 在Qt Designer中使用样式表
  9. C++二个数组求并集的实现算法(附完整源码)
  10. QT自定义图表上不同元素的外观