google-code-export / gdata-python-client

Automatically exported from code.google.com/p/gdata-python-client
1 stars 0 forks source link

Expose Deadline Parameter for API calls #556

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. call RetrievePageOfUsers
2. get error ApplicationError: 2 The read operation timed out
3. change library code to increase request deadline
4. Call succeeds

What is the expected output? What do you see instead?
- Expected would be when being able to set the deadline in the client object 
(client.deadline=30).  Or to be able to set the deadline in the method call 
(client.RetrievePageOfUsers(deadline=30).

Please use labels and text to provide additional information.
We have found a customer in which we cannot use the Python API to retrieve a 
page of users because the call times out.

Original issue reported on code.google.com by dli...@cloudlock.com on 31 Oct 2011 at 2:17

GoogleCodeExporter commented 9 years ago
This thread adds some background to this feature request:

https://groups.google.com/d/msg/google-apps-mgmt-apis/dnJ_r6VfaVg/1WjG6DdA4vcJ

Original comment by ccherub...@google.com on 31 Oct 2011 at 4:08

GoogleCodeExporter commented 9 years ago
Unfortunately the timeout parameter for httplib was only added to the Python 
2.6 version, so it will be a pain to add to this library and maintain backwards 
compatibility with Python 2.5, which this library currently supports. So I am 
extremely hesitant to break that.

You can probably do something like this before you import any gdata library:

import socket
socket.setdefaulttimeout(10)

But this will set the default socket timeout for everything socket-based, so 
may not serve your purpose exactly.

I have marked this as wontfix, but please by all means reopen if you wish to 
discuss it further.

Original comment by afs...@google.com on 17 Dec 2011 at 11:39