FunkLoad icon indicating copy to clipboard operation
FunkLoad copied to clipboard

Distributed bench run hangs at the end of the run

Open ndokos opened this issue 12 years ago • 1 comments

In addition to the main thread, there were threads (one per node) that were hanging around, preventing the return of main() in BenchRunner.py from completing. I added a line to kill all the workers and that did the trick:

...
if options.distribute:
    from Distributed import DistributionMgr
    ret = None
    try:
        distmgr = DistributionMgr(
            args[0], klass, method, options, cmd_args)
    except UserWarning, error:
        trace(red_str("Distribution failed with:%s \n" % (error)))

    try:
        distmgr.prepare_workers(allow_errors=True)
        ret = distmgr.run()
        distmgr.final_collect()
    except KeyboardInterrupt:
        trace("* ^C received *")
        distmgr.abort()

     # added this line
     [w.die() for w in distmgr._workers]
     return ret
else:
     ...

ndokos avatar Jul 25 '12 22:07 ndokos

I think you can simply call distmgr.abort() in any case in a finally statement.

See https://github.com/mozilla-services/FunkLoad/commit/db2af3c1de2bd14b5a15dc799383f5c35ae3d434

tarekziade avatar Aug 17 '12 10:08 tarekziade