Link worker greenlets to parent, so we abort if they have an unhandled exception.

This commit is contained in:
Tommi Virtanen 2011-07-20 11:04:32 -07:00
parent 9ecaf63fbe
commit 1eb38e09e4

View file

@ -119,7 +119,7 @@ def main():
print "Spawning {r} readers and {w} writers...".format(r=options.num_readers, w=options.num_writers) print "Spawning {r} readers and {w} writers...".format(r=options.num_readers, w=options.num_writers)
group = gevent.pool.Group() group = gevent.pool.Group()
for x in xrange(options.num_writers): for x in xrange(options.num_writers):
group.spawn( group.spawn_link_exception(
writer, writer,
bucket=bucket, bucket=bucket,
name=x, name=x,
@ -129,7 +129,7 @@ def main():
file_name_seed=r, file_name_seed=r,
) )
for x in xrange(options.num_readers): for x in xrange(options.num_readers):
group.spawn( group.spawn_link_exception(
reader, reader,
bucket=bucket, bucket=bucket,
name=x, name=x,