IMO the right solution is not to do the heavy lifting of this job on the master node at all, but that does introduce some complexity since the master is needed for some of the other steps, and making the execution process distributed introduces some new and exciting failure modes.
Tracking memory usage of reindexing in a circuit breaker is an interesting idea, possibly worth investigating further, but the end result for you would be that the enrich policy would simply fail with a CircuitBreakingException
. That's better than killing the master for sure but still doesn't really help.