Thanks so much for testing this out Marzia! It is really awesome how super helpful you are. You have helped me get one step closer to a solution...
I have my app setup to use my own domain. When I go directly to my appspot.com address it works: http://lenzasapp2.appspot.com/test?sleep=35 but going through my domain fails: http://apartmenthunter.lenza.org/test?sleep=35 This give you any ideas? Thanks again for your help! -Lenza On Feb 24, 1:20 pm, Marzia Niccolai <ma...@google.com> wrote: > Hi, > > I really am out of ideas since it works perfectly for me > (seehttp://yo.appspot.com/?sleep=2vshttp://yo.appspot.com/?sleep=35) where I > used your exact handler information. > > The issue is that, for some reason, the handler continues to execute too > long after the DeadlineExeededError is thrown. So when you see the Google > Page this is the expected behavior. But if all you do is render that simple > text after catching the error, it's strange that you exceed the second > deadline. > > Are you sure there are no indenting or other issues that may cause your > script to execute something after self.response.out.write("This is the > normal result message")? > > Also, it's worth mentioning that the dev_appserver does strictly enforce the > request limit times as the production system does, so it may not be > something you notice on the dev_appserver when trying to test. > > -Marzia > > On Tue, Feb 24, 2009 at 2:07 AM, lenza <le...@aznel.trickip.net> wrote: > > > Thanks for the response Marzia. I tried again with the return > > statement and I am still having the same issue. The code I pasted > > below is the entirety of my handler, so there is nothing in it that > > would cause a timeout after the initial DeadlineExceededError. I also > > checked that I am importing the correct DeadlineExceededError, and I > > can tell the error is being caught because I get the "Ran out of > > time." message in my logs. Any other ideas? > > > It is also interesting to note that for most exceptions I get a stack > > trace of the error. In this case I am getting a Google branded page > > titled "502 Server Error" that says: > > > Google Error > > > Server Error > > The server encountered a temporary error and could not complete > > your request. > > > Please try again in 30 seconds. > > > What is this page? > > > On Feb 23, 10:53 am, Marzia Niccolai <ma...@google.com> wrote: > > > Hi Lenza, > > > > This works for me. So I think it might be one of two things. > > > > First, are you importing the correct DeadlineExceededError? You need to > > > make sure to have this import: > > > from google.appengine.runtime import DeadlineExceededError > > > > If you don't, sleeping for 30 seconds will raise this error, but it won't > > be > > > caught. > > > > The other thing is that you need to explicitly return your handler after > > you > > > print the error message or else the handler will keep executing, and that > > > may be the cause of the error (not returning the message quick enough). > > So, > > > modify the exception with: > > > except DeadlineExceededError: > > > logging.error("Ran out of time.") > > > self.response.clear() > > > self.response.set_status(500) > > > self.response.out.write("This operation could not be completed in > > > time...") > > > return > > > > -Marzia > > > > On Sun, Feb 22, 2009 at 9:55 PM, lenza <le...@aznel.trickip.net> wrote: > > > > > I am attempting to customize my application response to a > > > > DeadlineExceededError. I am able to catch the exception, but my > > > > custom response is not getting through. Instead I get the default > > > > "502 Server Server Error" page even after clearing the response and > > > > writing a custom one. It seems as if the GAE is allowing time for > > > > cleanup, but ignoring anything written to the response object. Is > > > > anyone doing this successfully? > > > > > More details... > > > > > The GAE documentation states that you can customize your applications > > > > response to a DeadlineExceededError with the following example code > > > > (seehttp://code.google.com/appengine/docs/python/runtime.html): > > > > > class MainPage(webapp.RequestHandler): > > > > def get(self): > > > > try: > > > > # Do stuff... > > > > > except DeadlineExceededError: > > > > self.response.clear() > > > > self.response.set_status(500) > > > > self.response.out.write("This operation could not be completed > > > > in time...") > > > > > I have the following handler for "/test" on my App: > > > > > class TestPage(webapp.RequestHandle): > > > > def get(self): > > > > try: > > > > sleeptime = int(self.request.get('sleep')) > > > > if(sleeptime == 0): > > > > logging.info("Programatically raising > > > > DeadlineExceededError") > > > > raise DeadlineExceededError > > > > else: > > > > time.sleep(sleeptime) > > > > > except DeadlineExceededError: > > > > logging.error("Ran out of time.") > > > > self.response.clear() > > > > self.response.set_status(500) > > > > self.response.out.write("This operation could not be > > > > completed in time...") > > > > > logging.info("About to write normal result message") > > > > self.response.out.write("This is the normal result message") > > > > > When I request "/test?sleep=30" I get the "502 Server Server Error" > > > > page and the in my logs: > > > > > (E) 02-22 09:31PM 05.652 > > > > Ran out of time. > > > > (I) 02-22 09:31PM 05.653 > > > > About to write normal result message > > > > > When I request "/test?sleep=0" I get the expected "This operation > > > > could not be completed in time..." message page. Anyone know what's > > > > up with this? Thanks for any help! > > > > > -Lenza > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---