According to my investigation, the problem is that the applications in
the pending list are only activated when application is added or
removed. In contrast, when the metrics of a queue is updated (triggered
by either refreshing configuration or updating cluster resource), the
application activation function will not be called. So the solution is
obviously that when the queue metrics are updated, we need to activate
the pending applications if possible. Please have a look at the patch
for the details. It also includes the corresponding tests.