We introduced a conditional release of Task Executor in Resource Manager in
FLINK-10941. At the moment RM directly asks TE every release timeout whether it can be released (all depending consumers are done). We can piggyback TE/RM heartbeats for this purpose. In this case, we do not need additional RPC call to TE gateway and could potentially release TE quicker.