Commit Graph

12 Commits

Author SHA1 Message Date
Augie Fackler
9f876f6c89 cleanup: move stdlib imports to their own import statement
There are a few warnings still produced by my import checker, but
those are false positives produced by modules that share a name with
stdlib modules.
2013-11-06 16:48:06 -05:00
Matt Mackall
75eb7e7c7e worker: properly report errors from worker processes (issue3982) 2013-07-16 15:18:12 -05:00
Matt Mackall
e4e0d4a087 worker: check problem state correctly (issue3982)
If a large update triggered an abort, it was possible for the main
thread to still update the dirstate.

This fix is incomplete, as the failing worker now doesn't generate a
proper error message. This is difficult in the fork-based framework,
which relies on exceptions propagating to the top of the dispatcher
for formatting.
2013-07-16 11:53:53 -05:00
Bryan O'Sullivan
7fb4e0bf12 worker: add missing import of errno
Found using Cython.
2013-04-12 17:16:37 -07:00
Bryan O'Sullivan
c538c00399 worker: catch all exceptions, try to exit usefully/safely 2013-04-11 13:30:31 -07:00
Bryan O'Sullivan
0aa6f05307 worker: handle worker failures more aggressively
We now wait for worker processes in a separate thread, so that we can
spot failures in a timely way, wihout waiting for the progress pipe
to drain.

If a worker fails, we recover the pre-parallel-update behaviour of
failing early by killing its peers before propagating the failure.
2013-02-20 11:31:34 -08:00
Bryan O'Sullivan
0da2636c99 worker: fix a race in SIGINT handling
This is almost impossible to trigger due to the tiny time window involved.
2013-02-20 11:31:31 -08:00
Bryan O'Sullivan
9f53401ffd worker: on error, exit similarly to the first failing worker
Previously, if a worker failed, we exited with status 1. We now exit
with the correct exit code (killing ourselves if necessary).
2013-02-20 11:31:27 -08:00
Bryan O'Sullivan
5d849a878a worker: allow a function to be run in multiple worker processes
If we estimate that it will be worth the cost, we run the function in
multiple processes. Otherwise, we run it in-process.

Children report progress to the parent through a pipe.

Not yet implemented on Windows.
2013-02-09 15:51:32 -08:00
Bryan O'Sullivan
8ef1da44b3 worker: partition a list (of tasks) into equal-sized chunks 2013-02-09 15:51:32 -08:00
Bryan O'Sullivan
998baaf4d8 worker: estimate whether it's worth running a task in parallel
Not implemented for Windows yet.
2013-02-09 15:51:26 -08:00
Bryan O'Sullivan
46bf2f5a6f worker: count the number of CPUs
This works on the major platforms, and falls back to a safe guess of
1 elsewhere.
2013-02-09 15:22:12 -08:00