You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sentry.apache.org by "Sergio Peña (JIRA)" <ji...@apache.org> on 2018/01/29 17:22:00 UTC

[jira] [Resolved] (SENTRY-2124) LeaderStatusMonitor.toString() throws IllegalFormatConversionException with AtomicLong

     [ https://issues.apache.org/jira/browse/SENTRY-2124?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergio Peña resolved SENTRY-2124.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 2.1.0

Thanks, [~xyu2017] for your contribution. I applied this patch to master.

> LeaderStatusMonitor.toString() throws IllegalFormatConversionException with AtomicLong
> --------------------------------------------------------------------------------------
>
>                 Key: SENTRY-2124
>                 URL: https://issues.apache.org/jira/browse/SENTRY-2124
>             Project: Sentry
>          Issue Type: Bug
>          Components: Sentry
>    Affects Versions: 2.1.0
>            Reporter: Sergio Peña
>            Assignee: Xinran Tinney
>            Priority: Minor
>              Labels: bite-sized, newbie
>             Fix For: 2.1.0
>
>         Attachments: SENTRY-2124.001.patch
>
>
> When I start Sentry, I noticed an exception on the console due to an illegal format string in LeaderStatusMonitor.toString()
> {noformat}
> 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){noformat}
> Seems that the {{leaderCount=%d}} used in the String.format() is causing the issue.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)