Why can’t transactional tasks be named?

216 views
Skip to first unread message

Jeff Schnitzer

unread,
Apr 27, 2016, 3:43:43 PM4/27/16
to Google App Engine
My task queues sometimes have a lot of tasks sitting in them for various reasons (usually failing/retrying). I’d _really_ love to be able to look at a queue at a glance and see what’s in it. Instead it’s a wall of numbers.

Ah hah! I can name tasks, and this will show up in the interface, right?

I just tried that and get “transactional tasks cannot be named”. What’s the rationale for this? I get that the task name needs to be unique, but that can be fixed with a suffix…

This was asked in a SO question but the answer, although accepted, is bogus.

Any ideas?

Thanks,
Jeff

Kim Lewandowski

unread,
Apr 28, 2016, 7:18:11 PM4/28/16
to Google App Engine, je...@infohazard.org
Hi Jeff,

if we allowed named tasks then the transactional task could be rejected because the task name already exists.

"Task Name 1"  -> Datastore transaction -> AddTask to Queue
"Task Name 1" -> Datastore transaction (???) -> ????

Nickolas Daskalou

unread,
Apr 28, 2016, 8:09:17 PM4/28/16
to Google App Engine, je...@infohazard.org
Hi Kim,

Could we add a list of exceptions allowed to be thrown by the Task Queue service and still consider the transaction as successful?

E.g. (mostly stolen from here)

from google.appengine.api import taskqueue
from google.appengine.ext import ndb

@ndb.transactional
def do_something_in_transaction():
  taskqueue
.add(url='/path/to/my/worker', transactional=True, allow_transactional_exceptions=[taskqueue.TaskAlreadyExistsError, 
taskqueue.TombstonedTaskError])
  #...

do_something_in_transaction
()

Nick


--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/9970005d-cdd1-4d78-bf71-a2da58d1a465%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jeff Schnitzer

unread,
Apr 30, 2016, 1:31:38 PM4/30/16
to Kim Lewandowski, Google App Engine
(you can ignore my other message, which I sent before I read this - sorry)

Task naming in transactions can easily be fixed by adding a little random suffix to the name. Either Google can do it or we can do it, either way is fine.

I understand that task “names” conflate two behaviors:

 * Preventing duplicates
 * Display in the console

Not ideal but it’s what we have to work with. I can live with adding a UUID to the end of task names. It’s much harder to live with a console that doesn’t show at a glance what’s in the task queue :-(

Thanks,
Jeff


Adam (Cloud Platform Support)

unread,
May 1, 2016, 1:06:22 PM5/1/16
to Google App Engine, klewan...@google.com, je...@infohazard.org
I see this is reported as a feature request on the issue tracker. I will file this with the engineering team to have a reference number attached, and you can star the issue for visibility and to receive updates.

This comes with the usual disclaimer for features though, which is there is no guarantee of an ETA for any updates or that the feature will be implemented.
Reply all
Reply to author
Forward
0 new messages