Problem
FlinkAppHttpWatcher and SparkAppHttpWatcher schedule polling every 1 second and submit a new executor task for each app on every tick, even when the previous poll has not finished. This causes redundant REST calls and thread pool pressure.
Proposed solution
- Track in-flight watch tasks per application with
AtomicBoolean single-flight guard
- Skip scheduling when a watch is already running
- Clean up in-flight markers when an app is removed from the watch list
Problem
FlinkAppHttpWatcherandSparkAppHttpWatcherschedule polling every 1 second and submit a new executor task for each app on every tick, even when the previous poll has not finished. This causes redundant REST calls and thread pool pressure.Proposed solution
AtomicBooleansingle-flight guard