You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@yetus.apache.org by "Adam Faris (JIRA)" <ji...@apache.org> on 2016/12/20 07:17:58 UTC
[jira] [Comment Edited] (YETUS-460) RDM should handle connection
reset by peer
[ https://issues.apache.org/jira/browse/YETUS-460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15763494#comment-15763494 ]
Adam Faris edited comment on YETUS-460 at 12/20/16 7:17 AM:
------------------------------------------------------------
Hi Ajay, thanks for the feedback and I'm attaching a second patch. I decided to take a different approach by moving the duplicated urllib2 code from releasedockmaker and combining it in the utils module. In doing so I have a few questions for this request.
# What's the policy for adding external modules for testing? I know the Yetus project wants to minimize external module dependencies, but wasn't sure if this also applied to testing. I was considering the minimock module with doc string tests for the urllib2 changes.
# releasedocmaker, contained urllib2 proxy settings which don't appear to be used. ([click here|https://github.com/apache/yetus/blob/master/release-doc-maker/releasedocmaker.py#L716-L718]) Adding the proxy hooks back and exposing via optionParser seems like the right thing to do but perhaps is outside the scope of this jira. Thoughts?
# The load_jira method is slightly different then the other urllib2 blocks ([click here|https://github.com/apache/yetus/blob/master/release-doc-maker/releasedocmaker.py#L350-L351]) load_jira has additional exception handling that also catches httplib.BadStatusLine. While this is useful for capturing bad server responses, it's odd that only load_jira has it. I tried to keep handling that exception generic but am not completely happy with the change and am open to suggestions.
Thanks
was (Author: farisa):
Hi Ajay, thanks for the feedback and am attaching a second patch. I decided to take a different approach by moving the duplicated urllib2 code from releasedockmaker and combining it in the utils module. In doing so I have a few questions for this request.
# What's the policy for adding external modules for testing? I know the Yetus project wants to minimize external module dependencies, but wasn't sure if this also applied to testing. I was considering the minimock module with doc string tests for the urllib2 changes.
# releasedocmaker, contained urllib2 proxy settings which don't appear to be used. ([click here|https://github.com/apache/yetus/blob/master/release-doc-maker/releasedocmaker.py#L716-L718]) Adding the proxy hooks back and exposing via optionParser seems like the right thing to do but perhaps is outside the scope of this jira. Thoughts?
# The load_jira method is slightly different then the other urllib2 blocks ([click here|https://github.com/apache/yetus/blob/master/release-doc-maker/releasedocmaker.py#L350-L351]) load_jira has additional exception handling that also catches httplib.BadStatusLine. While this is useful for capturing bad server responses, it's odd that only load_jira has it. I tried to keep handling that exception generic but am not completely happy with the change and am open to suggestions.
Thanks
> RDM should handle connection reset by peer
> ------------------------------------------
>
> Key: YETUS-460
> URL: https://issues.apache.org/jira/browse/YETUS-460
> Project: Yetus
> Issue Type: Bug
> Components: Release Doc Maker
> Reporter: Allen Wittenauer
> Assignee: Adam Faris
> Attachments: YETUS-460.00.patch, YETUS-460.01.patch
>
>
> When a connection reset by peer error happens, we get a python stack trace. We should handle that better.
> {code}
> Traceback (most recent call last):
> File "/Users/aw/shared-vmware/yetus/release-doc-maker/releasedocmaker.py", line 907, in <module>
> main()
> File "/Users/aw/shared-vmware/yetus/release-doc-maker/releasedocmaker.py", line 748, in main
> jlist = sorted(JiraIter(vstr, projects))
> File "/Users/aw/shared-vmware/yetus/release-doc-maker/releasedocmaker.py", line 400, in __init__
> self.jiras = JiraIter.collect_jiras(ver, projects)
> File "/Users/aw/shared-vmware/yetus/release-doc-maker/releasedocmaker.py", line 379, in collect_jiras
> data = JiraIter.query_jira(ver, projects, pos)
> File "/Users/aw/shared-vmware/yetus/release-doc-maker/releasedocmaker.py", line 330, in query_jira
> return JiraIter.load_jira(params, 0)
> File "/Users/aw/shared-vmware/yetus/release-doc-maker/releasedocmaker.py", line 337, in load_jira
> params)
> File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
> return opener.open(url, data, timeout)
> File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 429, in open
> response = self._open(req, data)
> File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 447, in _open
> '_open', req)
> File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
> result = func(*args)
> File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1241, in https_open
> context=self._context)
> File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1201, in do_open
> r = h.getresponse(buffering=True)
> File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1136, in getresponse
> response.begin()
> File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 453, in begin
> version, status, reason = self._read_status()
> File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 409, in _read_status
> line = self.fp.readline(_MAXLINE + 1)
> File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 480, in readline
> data = self._sock.recv(self._rbufsize)
> File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 756, in recv
> return self.read(buflen)
> File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 643, in read
> v = self._sslobj.read(len)
> socket.error: [Errno 54] Connection reset by peer
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)