limeuser / appengine-ndb-experiment

Automatically exported from code.google.com/p/appengine-ndb-experiment
Other
0 stars 0 forks source link

AutoBatcher doesn't properly pass errors through Futures #196

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
    class Blobby(ndb.Model):
      blob = ndb.BlobProperty()

    ent1 = Blobby()
    ent2 = Blobby(blob='x'*2000000)
    fut1 = self.ctx.put(ent1)
    fut2 = self.ctx.put(ent2)
    err1 = fut1.get_exception()
    err2 = fut2.get_exception()
    print err1, err2

This code ends up sending a batch RPC for ent1 and ent2. This RPC fails because 
ent2 is too big. Now, I'm okay with this causing failure for both ent1 and 
ent2. However, the exception does not get passed properly through the futures 
-- the fut1.get_exception() call *raises* the exception instead of returning it!

Original issue reported on code.google.com by gvanrossum@gmail.com on 3 Jul 2012 at 1:45

GoogleCodeExporter commented 9 years ago
Review: http://codereview.appspot.com/6345061

Original comment by gvanrossum@gmail.com on 3 Jul 2012 at 2:00

GoogleCodeExporter commented 9 years ago
I will soon merge this into the default branch. This will be released with SDK 
1.7.1.

Original comment by guido@google.com on 9 Jul 2012 at 7:59