I have a pipeline of tasks (each task in the pipeline has different parallelism requirements), each task works in a different ExecutorService. Tasks work on packets of data, so if we have 10 datapackets then 10 tasks will be submitted to `service1`, one task per data packet. Once a task submitted to `service1` has actually invoked it may submit a new task to work further on the datapacket to `service2`, `service3` or not.

The following code works fine, i.e.:

* `shutdown()` is invoked on `service1` after everything has been submitted to `service1`
* Then awaitTermination() does not return until all the tasks that were submitted before the shutdown() have actually completed running.
-- `shutdown()` is then invoked on `service2` but because all tasks submitted to `service1` have completed, and all tasks are submitted to `service2` from tasks on `service1` all tasks have been submitted to `service2` before `shutdown()` is called on `service2`.
-- and so on for `service3`

```
ExecutorService[] services = {
        service1,
        service2,
        service3};

int count = 0;
for(ExecutorService service: services)
{   
    service.shutdown();
    service.awaitTermination(1, TimeUnit.HOURS);
}

```

However I have now added a case whereby `service2` can break a datapacket into a smaller packet and submit additional tasks on `service2` and the code is now failing. The problem is that `shutdown()` is called on `service2` once all the tasks on `service1` have completed, but now we want to submit additional `service2` tasks from a task running in `service2`

My questions:

1. Does `shutdown()` rerun after all submitted tasks have finished running, or does it return immediately but just doesn't stop already submitted tasks from running ? **Update:answered below**
2. How do I solve my new problem ?