Skip to content
New issue

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

bug fix: IllegalArgumentException: Invalid period 0.0 to calculate rate #14280

Merged
merged 1 commit into from Feb 15, 2022

Conversation

lordcheng10
Copy link
Contributor

@lordcheng10 lordcheng10 commented Feb 14, 2022

Motivation

use scheduleWithFixedDelay replace scheduleAtFixedRate in the class of ManagedLedgerFactoryImpl.
Because an exception was found in the broker log:

11:37:52.455 [bookkeeper-ml-scheduler-OrderedScheduler-24-0] ERROR org.apache.bookkeeper.common.util.SafeRunnable - Unexpected throwable caught
java.lang.IllegalArgumentException: Invalid period 0.0 to calculate rate
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:217) ~[com.google.guava-guava-30.1-jre.jar:?]
at org.apache.pulsar.common.stats.Rate.calculateRate(Rate.java:64) ~[org.apache.pulsar-pulsar-common-2.8.1.2.jar:2.8.1.2]
at org.apache.bookkeeper.mledger.impl.ManagedLedgerMBeanImpl.refreshStats(ManagedLedgerMBeanImpl.java:66) ~[org.apache.pulsar-managed-ledger-2.8.1.2.jar:2.8.1.2]
at org.apache.bookkeeper.mledger.impl.ManagedLedgerFactoryImpl.lambda$refreshStats$3(ManagedLedgerFactoryImpl.java:227) ~[org.apache.pulsar-managed-ledger-2.8.1.2.jar:2.8.1.2]
at java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4707) ~[?:1.8.0_144]
at org.apache.bookkeeper.mledger.impl.ManagedLedgerFactoryImpl.refreshStats(ManagedLedgerFactoryImpl.java:223) ~[org.apache.pulsar-managed-ledger-2.8.1.2.jar:2.8.1.2]
at org.apache.bookkeeper.common.util.SafeRunnable.run(SafeRunnable.java:36) [org.apache.bookkeeper-bookkeeper-common-4.14.2.jar:4.14.2]
at org.apache.bookkeeper.common.util.OrderedExecutor$TimedRunnable.run(OrderedExecutor.java:203) [org.apache.bookkeeper-bookkeeper-common-4.14.2.jar:4.14.2]
at org.apache.bookkeeper.common.util.OrderedExecutor$TimedRunnable.run(OrderedExecutor.java:203) [org.apache.bookkeeper-bookkeeper-common-4.14.2.jar:4.14.2]
at com.google.common.util.concurrent.MoreExecutors$ScheduledListeningDecorator$NeverSuccessfulListenableFutureTask.run(MoreExecutors.java:705) [com.google.guava-guava-30.1-jre.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_144]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_144]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_144]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_144]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_144]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_144]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [io.netty-netty-common-4.1.66.Final.jar:4.1.66.Final]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_144]

Documentation

Check the box below or label this PR directly (if you have committer privilege).

Need to update docs?

  • doc-required

    (If you need help on updating docs, create a doc issue)

  • no-need-doc

    (Please explain why)

  • doc

    (If this PR contains doc changes)

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Feb 14, 2022
@lordcheng10 lordcheng10 changed the title use scheduleWithFixedDelay replace scheduleAtFixedRate in the class of ManagedLedgerFactoryImpl bug fix: IllegalArgumentException: Invalid period 0.0 to calculate rate Feb 14, 2022
@lordcheng10
Copy link
Contributor Author

lordcheng10 commented Feb 14, 2022

@codelipenghui @michaeljmarshall
PTAL,thanks!

Copy link
Contributor

@codelipenghui codelipenghui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@lordcheng10
Copy link
Contributor Author

@michaeljmarshall
PTAL,thanks!

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@codelipenghui codelipenghui merged commit c331281 into apache:master Feb 15, 2022
@michaeljmarshall
Copy link
Member

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/broker cherry-picked/branch-2.8 Archived: 2.8 is end of life cherry-picked/branch-2.9 Archived: 2.9 is end of life doc-not-needed Your PR changes do not impact docs release/2.8.3 release/2.9.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants