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
jenkinsapi出现HTTPConnectionPool Max retires exceeded异常的更多相关文章
- Python requests 多线程抓取 出现HTTPConnectionPool Max retires exceeded异常
https://segmentfault.com/q/1010000000517234 -- ::, - oracle - ERROR - data format error:HTTPConnecti ...
- 使用threadpool并发测试,报错HTTPConnectionPool Max retires exceeded
解决方法:和以下答案一致 https://blog.csdn.net/qq_21405949/article/details/79363084 场景: 在做爬虫项目或者是在发送网络请求的时候,一般都会 ...
- HTTPConnectionPool(host='xx.xx.xx.xx', port=xx): Max retries exceeded with url:(Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x0000015A25025EB8>...))
HTTPConnectionPool(host='xx.xx.xx.xx', port=xx): Max retries exceeded with url:(Caused by ConnectTim ...
- HTTPConnectionPool(host:XX)Max retries exceeded with url 解决方法
爬虫多次访问同一个网站一段时间后会出现错误 HTTPConnectionPool(host:XX)Max retries exceeded with url '<requests.package ...
- HTTPConnectionPool(host:XX)Max retries exceeded with url
爬虫多次访问同一个网站一段时间后会出现错误 HTTPConnectionPool(host:XX)Max retries exceeded with url '<requests.package ...
- Max retries exceeded with url
78 Traceback (most recent call last): File "thread072413.py", line 163, in <module> ...
- Max retries exceeded with ur
requests模块在抓取网页时抛出ConnectionError异常,Max retries exceeded with url 主要搜下 "Caused by <class 'so ...
- python requests发起请求,报“Max retries exceeded with url”
需要高频率重复调用一个接口,偶尔会出现"Max retries exceeded with url" 在使用requests多次访问同一个ip时,尤其是在高频率访问下,http连接 ...
- 关于python3.6上传文件时报错:HTTPSConnectionPool(host='***.org', port=443): Max retries exceeded with url: /post (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAIL解决办法
第一个报错: 最近在练习post请求中上传文件时遇到了一个奇葩事情,两台电脑上写了一模一样的代码,一个运行正常,另一个一片红. 最后了解了一下原因以及解决办法.先记录下关键代码: files = {& ...
随机推荐
- C++ 类、对象、class
一.对象初始化 1.不能在类声明中对数据成员初始化,因为类只是一个抽象类型,不占存储空间,无处容纳数据. 2.若某类的数据成员都是public,则可以像结构体一样初始化,如 Time t={12,21 ...
- ssd训练自己的数据集
1.在ssd/caffe/data下创建VOC2007的目录,将ssd/caffe/data/VOC0712里的create_data.sh.create_list.sh和labelmap_voc.p ...
- Java B
3.继承时候类的执行顺序问题,一般都是选择题,问你将会打印出什么? 答:父类: package test; public class FatherClass { public FatherClass( ...
- [转载]C++、C#写的WebService相互调用
[转载]C++.C#写的WebService相互调用 首先感谢永和兄提供C++的WebService服务器端及客户端,并且陪我一起熬夜:然后是火石和我做接口的兄弟,虽然都不知道你叫什么,如果没有你 ...
- vue 清除keep-Alive页面缓存
- LOJ 2321 清华集训2017 无限之环 拆点+最小费用最大流
题面:中文题面,这里不占用篇幅 分析: 看到题面,我就想弃疗…… 但是作为任务题单,还是抄了题解…… 大概就是将每个格子拆点,拆成五个点,上下左右的触点和一个负责连源汇点的点(以下简称本点). 这个这 ...
- Linux下启动tomcat报java.lang.OutOfMemoryError: PermGen space
一.错误信息 java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke ...
- MongoDB安装与配置启动
1.下载安装包.mongodb-linux-x86_64-rhel62-3.6.3.tgz 2.解压.修改名字. 3.修改配置文件: # mongodb.conf #where to loglogpa ...
- linux 批量修改文件名 文件名只保留部分,去掉部分
问题:linux系统中文件名包含中文,导致页面访问不了文件.就是上条博客中的解决方法二遗留问题. 文件名中有以下格式:TC2_诺而达铜管(中山)有限公司.pdf ,要改为TC2.pdf,去掉中文部分 ...
- ruby on rails安装(win7x64)
Ruby下载地址http://rubyinstaller.org/downloads/ (以安装2.1.7为例,2.2.3未能安装成功) 安装完之后测试是否安装成功