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

[cherry-pick][branch-2.9] Fix NPE when ResourceGroupService execute scheduled task. #18685

Merged
merged 1 commit into from
Nov 30, 2022

Conversation

congbobo184
Copy link
Contributor

Motivation

When the broker closes, the scheduled task in ResourceGroupService may still execute, and cause NPE:

Sep 17 12:09:50 168-15-22-49 pulsar[8900]: 2022-09-17T12:09:50,050+0800 [pulsar-2-4] ERROR org.apache.pulsar.common.util.Runnables - Unexpected throwable caught
Sep 17 12:09:50 168-15-22-49 pulsar[8900]: java.lang.NullPointerException: null
Sep 17 12:09:50 168-15-22-49 pulsar[8900]: at org.apache.pulsar.broker.resourcegroup.ResourceGroupService.aggregateResourceGroupLocalUsages(ResourceGroupService.java:530) 
Sep 17 12:09:50 168-15-22-49 pulsar[8900]: at org.apache.pulsar.common.util.Runnables$CatchingAndLoggingRunnable.run(Runnables.java:54) 
Sep 17 12:09:50 168-15-22-49 pulsar[8900]: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
Sep 17 12:09:50 168-15-22-49 pulsar[8900]: at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[?:?]
Sep 17 12:09:50 168-15-22-49 pulsar[8900]: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
Sep 17 12:09:50 168-15-22-49 pulsar[8900]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
Sep 17 12:09:50 168-15-22-49 pulsar[8900]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
Sep 17 12:09:50 168-15-22-49 pulsar[8900]: at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) 
Sep 17 12:09:50 168-15-22-49 pulsar[8900]: at java.lang.Thread.run(Thread.java:829) ~[?:?]

Documentation

  • doc-not-needed
    (Please explain why)

Matching PR in forked repository

PR in forked repository: (https://github.com/Technoboy-/pulsar/pull/6)

@congbobo184 congbobo184 added doc-not-needed Your PR changes do not impact docs cherry-picked/branch-2.9 Archived: 2.9 is end of life release/2.9.4 labels Nov 30, 2022
@congbobo184 congbobo184 self-assigned this Nov 30, 2022
@congbobo184 congbobo184 removed the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Nov 30, 2022
@Technoboy- Technoboy- merged commit cc2956b into branch-2.9 Nov 30, 2022
@congbobo184 congbobo184 deleted the congbo/cherry-pick-2.9/#17840 branch December 1, 2022 09:31
@congbobo184 congbobo184 added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked/branch-2.9 Archived: 2.9 is end of life doc-not-needed Your PR changes do not impact docs release/2.9.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants