Yes, but I think the complexity of knowing the entire chain in advance would lead to bugs. In addition, it doesn't deal well with job forks (alternate jobs later in the chain), although I don't think we currently have any of those.
Something that would work and be easier to live with (I think) would be to add a second queue to the job manager, a 'job chain' queue, and another parameter to create_job indicating that this job is part of a chain. The job dispatcher would take jobs from that queue until empty, then take jobs from the normal queue. FD semantics ensure that the next job is queued before the first job terminates. Thus, if one uses FD around done and sets the job_chain parameter, then the chain will be atomic.
|