Hi John,
I managed to implement this and now I can do a proper clean up after
25seconds. But now I'm getting cpu_ms red warnings for every task I
run. I think that's exactly because it runs a method to calculate
the time spent in every iteration... Have you been able to optimize
this somehow? Or maybe it isn't even because of that, but if you
have some advice, I'm happy to take it.
Thank you again.
#06-09 08:25PM 26.600 /canalparser?main=updateShows&tasknumber=1 200
8262ms 2175cpu_ms 1320api_cpu_ms 0kb AppEngine-Google; (+http://code.google.com/appengine)
See details
0.1.0.2 - - [09/Jun/2010:20:25:34 -0700] "GET /canalparser?
main=updateShows&tasknumber=1 HTTP/1.1" 200 0 "http://tvguidebr.appspot.com/canalparser?main=scheduleShowsUpdate
" "AppEngine-Google; (+http://code.google.com/appengine)"
I 06-09 08:25PM 26.608 braziltvguide.ParseCanaisServlet doGet:
Starting thread
I 06-09 08:25PM 26.778 [tvguidebr/1.342561233485567613].<stdout>:
Updating Shows for AXN (1 of 112)
I 06-09 08:25PM 26.778 braziltvguide.ParseCanaisServlet
updateShows: Updating Shows for AXN (1 of 112)
I 06-09 08:25PM 34.855 braziltvguide.ParseCanaisServlet doGet:
Ending thread - Timer: 8247ms
#06-09 08:24PM 59.092 /canalparser?main=updateShows&tasknumber=0 200
17491ms 2666cpu_ms 1364api_cpu_ms 0kb AppEngine-Google; (+http://code.google.com/appengine)
See details
0.1.0.2 - - [09/Jun/2010:20:25:16 -0700] "GET /canalparser?
main=updateShows&tasknumber=0 HTTP/1.1" 200 0 "http://tvguidebr.appspot.com/canalparser?main=scheduleShowsUpdate
" "AppEngine-Google; (+http://code.google.com/appengine)"
I 06-09 08:24PM 59.391 braziltvguide.ParseCanaisServlet doGet:
Starting thread
I 06-09 08:24PM 59.572 [tvguidebr/1.342561233485567613].<stdout>:
Updating Shows for A&E Mundo (0 of 112)
I 06-09 08:24PM 59.572 braziltvguide.ParseCanaisServlet
updateShows: Updating Shows for A&E Mundo (0 of 112)
I 06-09 08:25PM 16.572 braziltvguide.ParseCanaisServlet doGet:
Ending thread - Timer: 17181ms
#06-09 08:24PM 58.807 /canalparser?main=scheduleShowsUpdate 200
569ms 1369cpu_ms 1039api_cpu_ms 0kb Mozilla/5.0 (Macintosh; U; Intel
Mac OS X 10.6; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/
3.6.3,gzip(gfe)
See details
201.29.172.42 - - [09/Jun/2010:20:24:59 -0700] "GET /
canalparser?main=scheduleShowsUpdate HTTP/1.1" 200 0 - "Mozilla/5.0
(Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.3) Gecko/
20100401 Firefox/3.6.3,gzip(gfe)"
I 06-09 08:24PM 58.821 braziltvguide.ParseCanaisServlet doGet:
Starting thread
I 06-09 08:24PM 59.115 braziltvguide.ParseCanaisServlet
scheduleShowsUpdate: Scheduling ShowsUpdate for channel 1 of 3
I 06-09 08:24PM 59.344 braziltvguide.ParseCanaisServlet
scheduleShowsUpdate: Scheduling ShowsUpdate for channel 2 of 3
I 06-09 08:24PM 59.370 braziltvguide.ParseCanaisServlet
scheduleShowsUpdate: Scheduling ShowsUpdate for channel 3 of 3
I 06-09 08:24PM 59.370 braziltvguide.ParseCanaisServlet doGet:
Ending thread - Timer: 549ms
Felipe Quintella
2010/6/7 John Patterson <jdpatter...@gmail.com>:
> Yes just use System.currentTimeMillis() to check in every
iteration of your
> tasks main loop.
>
> On 7 Jun 2010, at 09:57, Felipe Quintella Correia wrote:
>
>> I'll try this approach and start my clean up around 25seconds.
>>
>> Do you know any reliable timer I can count on? Or do I have to make
>> one of my own?
>>
>> Thank you very much.
>>
>> Felipe Quintella
>>
>>
>>
>> 2010/6/6 John Patterson <jdpatter...@gmail.com>:
>>>
>>> It looks like after catching the DEE a HardDEError is probably
thrown
>>> which
>>> causes the server instance to quit and the next request will
cause a new
>>> instance to be spun up.
>>>
>>> I had to give up catching DEE's - you don't get enough time to
reliably
>>> start a new task. The only option seems to be to start your
clean up
>>> code
>>> after 25 seconds for example.
>>>
>>> The other "request aborted..." errors are due to your app
restarting and
>>> taking too long. The request that kills the server instance is
followed
>>> by
>>> other requests that will time out after 10 seconds if you app
has not
>>> finished reloading.
>>>
>>> So two things to work on: 1) clean up task before DEE thrown 2)
speed up
>>> app loading time
>>>
>>> John
>>>
>>> On 6 Jun 2010, at 21:19, Felipe Quintella Correia wrote:
>>>
>>>> Hello,
>>>>
>>>> I hope someone can help me. Even though this is not a critical
>>>> problem, it's really annoying me. Every time i catch a
>>>> DeadlineExceededException and I try to patch things up and end my
>>>> thread properly I get a
>>>>
>>>> (Error code 104). I already tried searching everywhere, tried
ending
>>>> the thread immediately, throwing another exception, yadda
yadda... But
>>>> I always end up with this error after my logs. The clean up is
>>>> properly done, meaning I get what I should (new tasks in queue to
>>>> continue the process and the logs I made while cleaning up). I
really
>>>> have no idea what to do.
>>>>
>>>> Log:
>>>>
>>>> #06-05 10:21PM 33.811 /canalparser?
main=updateShows&tasknumber=29 200
>>>> 33423ms 4487cpu_ms 2135api_cpu_ms 0kb AppEngine-Google;
>>>> (+http://code.google.com/appengine)
>>>> See details
>>>>
>>>> 0.1.0.2 - - [05/Jun/2010:22:22:07 -0700] "GET
>>>> /canalparser?main=updateShows&tasknumber=29 HTTP/1.1" 200 0
>>>> "http://tvguidebr.appspot.com/canalparser?main=scheduleShowsUpdate
"
>>>> "AppEngine-Google; (+http://code.google.com/appengine)"
>>>> "tvguidebr.appspot.com"
>>>>
>>>> I 06-05 10:21PM 38.099
>>>>
>>>> braziltvguide.ParseCanaisServlet doGet: Starting thread
>>>>
>>>> I 06-05 10:21PM 38.289
>>>>
>>>> braziltvguide.ParseCanaisServlet updateShows: Updating Shows
for
>>>> E! Entertainment (29 of 112)
>>>>
>>>> W 06-05 10:22PM 07.079
>>>>
>>>> braziltvguide.ParseCanaisServlet updateShows: Deadline
Detected
>>>> - Ending Thread
>>>>
>>>> I 06-05 10:22PM 07.079
>>>>
>>>> braziltvguide.ParseCanaisServlet doGet: Ending thread - Timer:
>>>> 28980ms
>>>>
>>>> W 06-05 10:22PM 07.215
>>>>
>>>> A serious problem was encountered with the process that
handled
>>>> this request, causing it to exit. This is likely to cause a new
>>>> process to be used for the next request to your application. If
you
>>>> see this message frequently, you may be throwing exceptions
during the
>>>> initialization of your application. (Error code 104)
>>>>
>>>>
>>>>
>>>> Another error I get in a frequent basis, but I don't know if
they are
>>>> related is:
>>>> 06-05 10:21PM 43.823
>>>>
>>>> Request was aborted after waiting too long to attempt to
service your
>>>> request. This may happen sporadically when the App Engine serving
>>>> cluster is under unexpectedly high or uneven load. If you see
this
>>>> message frequently, please contact the App Engine team.
>>>>
>>>>
>>>> The task eventually gets done after retrying a certain number
of times
>>>> (usually 1 but all the way up to 5 or 6).
>>>>
>>>> Thank you in advance,
>>>> Felipe Quintella
>>>>
>>>> --
>>>> You received this message because you are subscribed to the
Google
>>>> Groups
>>>> "Google App Engine for Java" group.
>>>> To post to this group, send email to
>>>> google-appengine-j...@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> google-appengine-java+unsubscr...@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/google-appengine-java?hl=en.
>>>>
>>>
>>> --
>>> You received this message because you are subscribed to the
Google Groups
>>> "Google App Engine for Java" group.
>>> To post to this group, send email to
>>> google-appengine-j...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> google-appengine-java+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-appengine-java?hl=en.
>>>
>>>
>>
>> --
>> You received this message because you are subscribed to the
Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-j...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google
Groups
> "Google App Engine for Java" group.
> To post to this group, send email to google-appengine-java@googlegroups.com
.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
--
You received this message because you are subscribed to the Google
Groups "Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
.
To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com
.
For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en
.