Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-4224

Avoid NPE after HeartbeatHandler deactivation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • Discovery Impl 1.0.12
    • Discovery Impl 1.1.0
    • Extensions
    • None

    Description

      The following order of messages, including a NPE, where witnessed:

      27.11.2014 17:04:53.913 *INFO* [FelixShutdown] org.apache.felix.framework BundleEvent STOPPING
      ...
      27.11.2014 17:05:07.080 *INFO* [FelixStartLevel] org.apache.sling.discovery.impl Service [org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler,3149] ServiceEvent UNREGISTERING
      ...
      27.11.2014 17:05:07.094 *ERROR* [pool-9-thread-1] org.apache.sling.commons.scheduler.impl.QuartzScheduler Exception during job execution of org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler@4d2581b9 : null
      java.lang.NullPointerException: null
                     at org.apache.sling.discovery.impl.cluster.voting.VotingHelper.listOpenNonWinningVotings(VotingHelper.java:53)
                     at org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler.doCheckView(HeartbeatHandler.java:441)
                     at org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler.checkView(HeartbeatHandler.java:409)
                     at org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler.run(HeartbeatHandler.java:212)
                     at org.apache.sling.commons.scheduler.impl.QuartzJobExecutor.execute(QuartzJobExecutor.java:105)
                     at org.quartz.core.JobRunShell.run(JobRunShell.java:207)
                     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
                     at java.lang.Thread.run(Thread.java:745)
      

      This indicates, that the HeartbeatHandler is executing the checkView method even after deactivation - thus having the config null - thus running into a NPE.

      Attachments

        Activity

          People

            stefanegli Stefan Egli
            stefanegli Stefan Egli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: