Goal of this ticket is to ensure the executor doesn't have to know each single instances of what it destroys at shutdown time.
Proposal is to have a list of closeable (or autocloseable) which and a registerCloseable which would decouple it.
Side note: it is still key to ensure the list is 1. sorted and 2. any error doesn't prevent to call next element
Imported from Jira BEAM-4039. Original Jira may contain additional context.
Reported by: romain.manni-bucau.