Skip to content

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

Merged
Technoboy- merged 2 commits intoapache:branch-2.9from
congbobo184:congbo/cherry-pick/#17840
Nov 8, 2022
Merged

[cherry-pick][branch-2.9] Fix NPE when ResourceGroupService execute scheduled task.#18389
Technoboy- merged 2 commits intoapache:branch-2.9from
congbobo184:congbo/cherry-pick/#17840

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)

@Technoboy- Technoboy- merged commit 8339e84 into apache:branch-2.9 Nov 8, 2022
congbobo184 added a commit that referenced this pull request Nov 30, 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 release/2.9.4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants