Description
Issues include:
- CommonNodeLabelsManager#addToCluserNodeLabels should not change the value in labelCollections if the key already exists otherwise the Label.resource will be changed(reset).
- potential NPE(NullPointerException) in checkRemoveLabelsFromNode of CommonNodeLabelsManager.
- because when a Node is created, Node.labels can be null.
- In this case, nm.labels; may be null. So we need check originalLabels not null before use it(originalLabels.containsAll).
- addToCluserNodeLabels should be protected by writeLock in RMNodeLabelsManager.java. because we should protect labelCollections in RMNodeLabelsManager.
- Fix a potential bug in CommonsNodeLabelsManager, after serviceStop(...) is invoked, some event may not be processed, see comment