We poll for resources in two different ways,
- From the client we poll using an interval
- From Nodejs where we start to poll for a resource when we receive poll-start message and stop when we receive poll-stop message.
The second approach is problematic when CDAP sits behind proxies that are not 100% guaranteed to send a poll-stop or a socket close message (network drop). This is problematic as during these cases we start to leak polling and this eventually creates a lot of requests to appfabric over a period of time.
As fix-forward solution we need to move all the polling to client, that way the app-fabric is isolated when clients drop or go out of network. The requests scale based on client usage and there are no leaks.