Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7070955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:37:44+00:00 2026-05-28T05:37:44+00:00

I am writing a deferred task which is intended to construct a file in

  • 0

I am writing a deferred task which is intended to construct a file in the blobstore for download. I am modelling the code on the example given in the docs:

http://code.google.com/appengine/articles/deferred.html

The idea is to structure the code so that if there is a DeadlineExceededError the handler can tidy up and kick off a new deferred task to continue later.

What I’d like to know is when exactly can this exception be thrown? Are there any operations which are guaranteed to be atomic and therefore will not be interrupted?

In the example (referenced above) they update a variable called start_key as they finish processing each record, but say the main loop was interrupted between the extending of the to_put and to_delete lists then the data would be wrong, as it would do miss a set of deletes.

If an exception can be raised at any point then it could be halfway through the batch_write, or between the db.put and clearing of the to_put list.

This is logically equivalent to a thread safety problem, to solve it one normally has guaranteed atomic operations and non-atomic operations.

How does this work?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:37:45+00:00Added an answer on May 28, 2026 at 5:37 am

    A DeadlineExceededError can be thrown literally any time at all. If there were a time when it couldn’t be thrown, an abusive app could simply execute that code in a loop.

    You can avoid this several ways:

    1. Proactively check how long you’ve been executing for and stop at a good time before you hit the deadline.
    2. Put the exception handler somewhere that it can store the state as of the last set of completed operations (eg, discarding anything since the last iteration of the outer loop in which the exception was thrown)
    3. Use backends, which do not have deadlines.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Writing some docs with code snippets which I want to be copyable to run
I am using this article of architecture http://blog.extjs.eu/know-how/writing-a-big-application-in-ext/ This is my grid file Application.DashBoardGrid
Writing GWT application. I have CellTable and a code that i'v got from google-example
Writing the code for the user authentication portion of a web site (including account
Writing documentation in html requires some code examples. What to do with characters that
While writing JavaScript code, I Separate each code block with <script> tags <script type=text/javascript>
I'm writing a simple parser/interpreter for a language . The instructions keep mentioning 'deferred
Say you have the following piece of code: function someProcess() { var deferred =
Writing some drag&drop code, I'd like to cancel the click events in my mouseup
Writing/reading code seems less stress then preparing a deploy scripts such as ./configure then

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.