Skip to content

[fix][broker] Fix NPE when ResourceGroupService execute scheduled task. - #17840

Merged
codelipenghui merged 1 commit into
apache:masterfrom
Technoboy-:fix-resource-group-NPE
Sep 28, 2022
Merged

codelipenghui merged 1 commit into
apache:masterfrom
Technoboy-:fix-resource-group-NPE

Conversation

@Technoboy-

Copy link
Copy Markdown
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- self-assigned this Sep 26, 2022
@Technoboy- Technoboy- added this to the 2.12.0 milestone Sep 26, 2022
@Technoboy- Technoboy- closed this Sep 27, 2022
@Technoboy- Technoboy- reopened this Sep 27, 2022
@codelipenghui
codelipenghui merged commit 62d900f into apache:master Sep 28, 2022
@Technoboy- Technoboy- modified the milestones: 2.12.0, 2.11.0 Sep 28, 2022
nicoloboschi pushed a commit that referenced this pull request Oct 25, 2022
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Oct 25, 2022
congbobo184 pushed a commit to congbobo184/pulsar that referenced this pull request Nov 8, 2022
@congbobo184 congbobo184 added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Nov 8, 2022
@Technoboy-
Technoboy- deleted the fix-resource-group-NPE branch November 11, 2023 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants