Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timeout option to get_url #6751

Closed
pzhine opened this issue Mar 29, 2014 · 6 comments
Closed

Add timeout option to get_url #6751

pzhine opened this issue Mar 29, 2014 · 6 comments

Comments

@pzhine
Copy link

@pzhine pzhine commented Mar 29, 2014

Issue Type:

“Feature Idea”

Ansible Version:

1.5.3

Environment:

Ubuntu 12.04

Summary:

We should be able to specify a timeout for get_url for downloading larger files (or for hitting longer running endpoints).

Right now, it looks like it's fixed at 10 seconds, the default for the timeout param of fetch_url.

Steps To Reproduce:
Expected Results:

TASK: [warmup cache] **********************************************************
changed: [12.34.12.34]

Actual Results:

TASK: [warmup cache] **********************************************************
fatal: [12.34.12.34] => failed to parse: SUDO-SUCCESS-auisjvazbmvdmhizbletefqldvuexvtd
Traceback (most recent call last):
File "/home/ubuntu/.ansible/tmp/ansible-tmp-1396050193.29-76687999901185/get_url", line 1664, in
main()
File "/home/ubuntu/.ansible/tmp/ansible-tmp-1396050193.29-76687999901185/get_url", line 209, in main
tmpsrc, info = url_get(module, url, dest, use_proxy, last_mod_time, force)
File "/home/ubuntu/.ansible/tmp/ansible-tmp-1396050193.29-76687999901185/get_url", line 134, in url_get
rsp, info = fetch_url(module, url, use_proxy=use_proxy, force=force, last_mod_time=last_mod_time)
File "/home/ubuntu/.ansible/tmp/ansible-tmp-1396050193.29-76687999901185/get_url", line 1652, in fetch_url
r = urllib2.urlopen(request, None, timeout)
File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 406, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 519, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 438, in error
result = self._call_chain(_args)
File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
result = func(_args)
File "/usr/lib/python2.7/urllib2.py", line 890, in http_error_401
url, req, headers)
File "/usr/lib/python2.7/urllib2.py", line 865, in http_error_auth_reqed
response = self.retry_http_basic_auth(host, req, realm)
File "/usr/lib/python2.7/urllib2.py", line 878, in retry_http_basic_auth
return self.parent.open(req, timeout=req.timeout)
File "/usr/lib/python2.7/urllib2.py", line 400, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 418, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1207, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1180, in do_open
r = h.getresponse(buffering=True)
File "/usr/lib/python2.7/httplib.py", line 1030, in getresponse
response.begin()
File "/usr/lib/python2.7/httplib.py", line 407, in begin
version, status, reason = self._read_status()
File "/usr/lib/python2.7/httplib.py", line 365, in _read_status
line = self.fp.readline()
File "/usr/lib/python2.7/socket.py", line 447, in readline
data = self._sock.recv(self._rbufsize)
socket.timeout: timed out

@mpdehaan
Copy link
Contributor

@mpdehaan mpdehaan commented Mar 29, 2014

Sounds reasonable. Something you would like to work on, perhaps?

@pzhine
Copy link
Author

@pzhine pzhine commented Mar 29, 2014

Yeah, I'll work on a pull request.

@geerlingguy
Copy link
Contributor

@geerlingguy geerlingguy commented Apr 28, 2014

👍

@evgeny-goldin
Copy link

@evgeny-goldin evgeny-goldin commented Sep 6, 2014

+1!

@mpdehaan
Copy link
Contributor

@mpdehaan mpdehaan commented Sep 29, 2014

Hi!

Thanks very much for your interest in Ansible. It sincerely means a lot to us.

On September 26, 2014, due to enormous levels of contribution to the project Ansible decided to reorganize module repos, making it easier
for developers to work on the project and for us to more easily manage new contributions and tickets.

We split modules from the main project off into two repos, http://github.com/ansible/ansible-modules-core and http://github.com/ansible/ansible-modules-extras

If you would still like this ticket attended to, and believe this problem or idea is still present in the latest version of Ansible (1.7.2) or the development branch, we will need your help in having it reopened in one of the two new repos, and instructions are provided below.

We apologize that we are not able to make this transition happen seamlessly, though this is a one-time change and your help is greatly appreciated --
this will greatly improve velocity going forward.

Both sets of modules will ship with Ansible, though they'll receive slightly different ticket handling.

To locate where a module lives between 'core' and 'extras'

Additionally, should you need more help with this, you can ask questions on:

Thank you very much!

@geerlingguy
Copy link
Contributor

@geerlingguy geerlingguy commented Sep 29, 2014

Sure thing! Moved over to ansible/ansible-modules-core#20.

@ansibot ansibot added feature and removed feature_idea labels Mar 2, 2018
@dagwieers dagwieers added the net_tools label Mar 3, 2019
@ansible ansible locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

6 participants
You can’t perform that action at this time.