We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The class RunnableOnMaster implements a TopologyEventListener and dereferences TopologyEvent.getNewView() in its handleTopologyEvent method (
RunnableOnMaster
TopologyEventListener
TopologyEvent.getNewView()
handleTopologyEvent
acs-aem-commons/bundle/src/main/java/com/adobe/acs/commons/util/RunnableOnMaster.java
Line 45 in 05e6e86
This might lead to a NPE as getNewView might return null (https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/javadoc/org/apache/sling/discovery/TopologyEvent.html#getNewView--). In general it is not wise to rely on the TopologyEventListener just to figure out if the current instance is the leader, as you cannot predict when the topology events are received. Instead one should rely on DiscoveryService.getTopologyView() as that always gives the current status.
getNewView
null
A similar issue was detected in #2492
The text was updated successfully, but these errors were encountered:
Introduce marker interface for ClusterLeader
8eb4e2c
Automatically generate service of that type. Leverage from JcrPackageReplicationStatusEventHandler and TwitterFeedScheduler. This closes Adobe-Consulting-Services#2492 Adobe-Consulting-Services#2498
Introduce marker interface for ClusterLeader (#2499)
ddd20a2
Automatically generate service of that type. Leverage from JcrPackageReplicationStatusEventHandler and TwitterFeedScheduler. This closes #2492 #2498
No branches or pull requests
The class
RunnableOnMaster
implements aTopologyEventListener
and dereferencesTopologyEvent.getNewView()
in itshandleTopologyEvent
method (acs-aem-commons/bundle/src/main/java/com/adobe/acs/commons/util/RunnableOnMaster.java
Line 45 in 05e6e86
This might lead to a NPE as
getNewView
might returnnull
(https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/javadoc/org/apache/sling/discovery/TopologyEvent.html#getNewView--). In general it is not wise to rely on theTopologyEventListener
just to figure out if the current instance is the leader, as you cannot predict when the topology events are received. Instead one should rely on DiscoveryService.getTopologyView() as that always gives the current status.A similar issue was detected in #2492
The text was updated successfully, but these errors were encountered: