mill
mill copied to clipboard
Close downstream workers in reverse order before closing a worker
Motivations:
-
A downstream worker (e.g. a server) that depends on a worker (e.g. a classloader) might no longer be functioning correctly, once its dependencies are closed (e.g. loading of new resources might fail), hence before closing a worker we should close all potential users of it.
-
Once an upstream worker needs to be recreated, new resources (memory, open files, sockets) might need to be acquired. If we close all no longer valid workers at this stage, we free up resources (which are invalid anyways) early and reduce the overall resource pressure on the OS.