Uploaded image for project: 'Sentry (Retired)'
  1. Sentry (Retired)
  2. SENTRY-2124

LeaderStatusMonitor.toString() throws IllegalFormatConversionException with AtomicLong

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.1.0
    • 2.1.0
    • Sentry

    Description

      When I start Sentry, I noticed an exception on the console due to an illegal format string in LeaderStatusMonitor.toString()

      java.util.IllegalFormatConversionException: d != java.util.concurrent.atomic.AtomicLong 
      at java.util.Formatter$FormatSpecifier.failConversion(Formatter.java:4302) 
      at java.util.Formatter$FormatSpecifier.printInteger(Formatter.java:2793) 
      at java.util.Formatter$FormatSpecifier.print(Formatter.java:2747) 
      at java.util.Formatter.format(Formatter.java:2520) 
      at java.util.Formatter.format(Formatter.java:2455) 
      at java.lang.String.format(String.java:2940) 
      at org.apache.sentry.provider.db.service.persistent.LeaderStatusMonitor.toString(LeaderStatusMonitor.java:282) 
      at org.slf4j.helpers.MessageFormatter.safeObjectAppend(MessageFormatter.java:297) 
      at org.slf4j.helpers.MessageFormatter.deeplyAppendParameter(MessageFormatter.java:269) 
      at org.slf4j.helpers.MessageFormatter.arrayFormat(MessageFormatter.java:227) 
      at org.slf4j.helpers.MessageFormatter.format(MessageFormatter.java:124) 
      at org.slf4j.impl.Log4jLoggerAdapter.info(Log4jLoggerAdapter.java:322) 
      at org.apache.sentry.provider.db.service.persistent.LeaderStatusMonitor.takeLeadership(LeaderStatusMonitor.java:251) 
      at sentry.org.apache.curator.framework.recipes.leader.LeaderSelector$WrappedListener.takeLeadership(LeaderSelector.java:537) 
      at sentry.org.apache.curator.framework.recipes.leader.LeaderSelector.doWork(LeaderSelector.java:399) 
      at sentry.org.apache.curator.framework.recipes.leader.LeaderSelector.doWorkLoop(LeaderSelector.java:444) 
      at sentry.org.apache.curator.framework.recipes.leader.LeaderSelector.access$100(LeaderSelector.java:64) 
      at sentry.org.apache.curator.framework.recipes.leader.LeaderSelector$2.call(LeaderSelector.java:245) 
      at sentry.org.apache.curator.framework.recipes.leader.LeaderSelector$2.call(LeaderSelector.java:239) 
      at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
      at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)

      Seems that the leaderCount=%d used in the String.format() is causing the issue.

      Attachments

        1. SENTRY-2124.001.patch
          0.9 kB
          Xinran Tinney

        Issue Links

          Activity

            People

              xyu2017 Xinran Tinney
              spena Sergio Peña
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: