I have an elasticsearch cluster running with a handful of nodes and it periodically (as in every few minutes) falls down with a master_not_discovered_exception. While investigating I notice that when I check _cat/pending_tasks there are hundreds of pending tasks with source == "add_listener".
Example:
672140 387ms HIGH _add_listener_
I'm trying to find out what kind of requests result in an add_listener task so that I can track down the source of the requests. Any help would be greatly appreciated.