Error Errno 35 Resource Temporarily Unavailable
Contents |
Sign in Pricing Blog Support Search GitHub This repository Watch 75 Star 1,128 Fork 380 shazow/urllib3 Code Issues 83 Pull requests socket.error errno 35 resource temporarily unavailable 33 Projects 0 Pulse Graphs New issue [Errno 35] 'Resource temporarily unavailable' socket error errno 11 resource temporarily unavailable on Mac OS X #63 Closed dtebbs opened this Issue Mar 20, 2012 · 13 comments Projects
Oserror Errno 11 Resource Temporarily Unavailable
None yet Labels None yet Milestone No milestone Assignees No one assigned 4 participants dtebbs commented Mar 20, 2012 We are seeing "error(35, 'Resource temporarily
Errno 11 Resource Temporarily Unavailable Python
unavailable')" thrown from urllib when running on mac. It appears this is a known issue in python, when the caller of send must handle EAGAIN errors on BSD platforms. This was observed with urllib3-1.1, OSX 10.6, Python 2.7. Not surprisingly, it's particularly common over slow network connections. Owner shazow commented Mar 20, 2012 Hi @dtebbs, thanks for the pthread_create failed errno 11 resource temporarily unavailable bug report! Any thoughts on what the solution would be? We can put a try/except block to catch EAGAIN but what's the correct course of action once we catch it? Should we simply retry? dtebbs commented Mar 21, 2012 Yes, I believe the solution is a try/except block that keeps retrying the send until it either succeeds or a different exception is thrown. I have code that looks something like this (in this case I know in advance that we want to read exactly size_bytes bytes): while len(self.buffer) < size_bytes: try: self._read() # <==== Calls socket.recv() and updates self.buffer except socket.error as ex: if str(ex) == "[Errno 35] Resource temporarily unavailable": time.sleep(0) continue raise ex There may be a better way to detect the exception type rather than a string comparison. Owner shazow commented Mar 21, 2012 Fun times, so this would need to happen on the httplib.HTTPConnection layer... dtebbs commented Mar 21, 2012 Ah. Yes, I guess so. I'll try and get a full call stack (as I should
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business
Python Oserror Errno 35 Resource Temporarily Unavailable
Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation errno 35 resource deadlock avoided Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just oserror: [errno 35] resource temporarily unavailable multiprocessing like you, helping each other. Join them; it only takes a minute: Sign up App Engine: Error: [Errno 35] Resource temporarily unavailable up vote 1 down vote favorite My AppEngine application uses urlfetch to hit a web server https://github.com/shazow/urllib3/issues/63 that I have running on a computer under my desk. Occasionally, the call fails with the following error, which I'm hoping you can help me with: Error: [Errno 35] Resource temporarily unavailable Herewith, the specifics. The call to urlfetch runs inside a task and is: r = urlfetch.fetch( URL, payload = urllib.urlencode( { selector: ','.join(records), 'reason': explain_request, } ), method = urlfetch.POST, deadline = 600, ) Some observations: The calls generally seem to fail when http://stackoverflow.com/questions/16722618/app-engine-error-errno-35-resource-temporarily-unavailable the list of records is long (e.g. 100 KBytes after the "join") and succeed when the list is short. (N.B.: I am not near to exceeding the size limit on a urlfetch request, which is 10 MB according to this page.) I have only tried this in the GAE development environment, never deployed on GAE itself. When I run the server on the same computer as my GAE development environment, the urlfetch calls always succeed. As far as the server on the computer under my desk: It is not responding slowly. It takes under a second, or maybe just over a second to compute its response. It's as if GAE does not wait for the response. It is connected to the GAE development environment computer via the Internet as a whole (i.e. not an intranet) I implemented it the first time using Python's SimpleHTTPServer. I implemented it the second time using CherryPy. The only changes I made to CherryPy's default config were setting the port and setting server.socket_host to '0.0.0.0'. Based on what I've read on the web about blocking and non-blocking servers, the next thing I would try is implementing the server using an explicitly asynchronous server like Tornado. But blocking and nonblocking were new concepts to me as of yesterday, so I'm hoping that someone with a true understanding can poi
User List Committer List Help Tracker Documentation Tracker Development Report Tracker Problem Issue8493 classification Title: socket's send can raise errno 35 under OS X, which causes problems in sendall Type: Stage: Components: Library (Lib) Versions: Python 2.6 process Status: closed http://bugs.python.org/issue8493 Resolution: Dependencies: Superseder: Assigned To: Nosy List: exarkun, mdcowles, neologix, pitrou Priority: normal Keywords: Created on 2010-04-21 20:40 by mdcowles, last changed 2010-04-27 19:45 by mdcowles. This issue is now closed. Messages (18) msg103908 - (view) Author: Matthew Cowles (mdcowles) Date: 2010-04-21 20:40 [From a question first posted to python-help] A socket's send function may return 0 if no bytes have been sent. Under at least OS X 10.6.2, it resource temporarily may also raise errno 35 (resource temporarily unavailable) if no network buffers are available. If a Python coder is using socket.send() that's no problem. They can catch the exception and try again. but it makes socket.sendall() (which is implemented as calls to send() ) not very useful. I expect that it would be fairly easy to have it check for that error number in addition to checking for an incomplete send. resource temporarily unavailable As far as I'm aware, it's only OS X that ever does that. msg103974 - (view) Author: Charles-François Natali (neologix) * Date: 2010-04-22 17:44 The problem is that if you run out of "network buffers" (I guess it's equivalent to Unix socket buffers), what do you do ? If the network or the receiving host is congested, spinning around the send call trying to resend the data isn't going to improve things, you should probably wait a little before retrying. Furthermore, if you get this type of error, it's probably because you're using non-blocking sockets. And if it's the case, you should be prepared to this type of transient error, and use socket.send instead (so that you can sleep, retry, etc if necesssary). msg104024 - (view) Author: Matthew Cowles (mdcowles) Date: 2010-04-23 15:43 > if you get this type of error, it's probably because you're using non- > blocking sockets That's what I thought at first too. But the user's sockets were set to blocking. > spinning around the send call trying to resend the data isn't going to > improve things, you should probably wait a little before retrying The user switched to using send() and adding a short delay before retrying the send solved the problem. In fac