Skip to content

[fix][broker] managedLedger.getConfig().getProperties().putAll(properties) NPE - #20361

Merged
nodece merged 1 commit into
apache:masterfrom
heesung-sohn:managedLedgerConfig-Properties-NPE
May 20, 2023
Merged

[fix][broker] managedLedger.getConfig().getProperties().putAll(properties) NPE#20361
nodece merged 1 commit into
apache:masterfrom
heesung-sohn:managedLedgerConfig-Properties-NPE

Conversation

@heesung-sohn

@heesung-sohn heesung-sohn commented May 19, 2023

Copy link
Copy Markdown
Contributor

Motivation

Old topics/ledgers before #17238 can have null ManagedLedgerConfig.properties.

hsohn@HeesungSohns-MacBook-Pro sn-pulsar % curl --location --request PUT 'http://localhost:8080/admin/v2/persistent/my-tenant/my-namespace-1/my-topic-11/properties' \
--header 'Authorization: Bearer <REDACTED>' \
--header 'Content-Type: application/json' \
--data-raw '{
"api_name_one": "test4"
}'

An unexpected error occurred in the server ---

Message: java.util.concurrent.CompletionException: java.lang.NullPointerException

Stacktrace:

org.apache.bookkeeper.mledger.ManagedLedgerException$MetaStoreException: java.util.concurrent.CompletionException: java.lang.NullPointerException
Caused by: java.util.concurrent.CompletionException: java.lang.NullPointerException
\tat java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
\tat java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
\tat java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718)
\tat java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
\tat org.apache.bookkeeper.common.util.OrderedExecutor$TimedRunnable.run(OrderedExecutor.java:203)
\tat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
\tat java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
\tat io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
\tat java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.NullPointerException
\tat org.apache.pulsar.broker.admin.impl.PersistentTopicsBase$1.updatePropertiesComplete(PersistentTopicsBase.java:692)
\tat org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl$25.operationComplete(ManagedLedgerImpl.java:4071)
\tat org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl$25.operationComplete(ManagedLedgerImpl.java:4067)
\tat org.apache.bookkeeper.mledger.impl.MetaStoreImpl.lambda$asyncUpdateLedgerIds$7(MetaStoreImpl.java:161)
\tat java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714)
\t... 9 more
"}%

Modifications

Added a null check when adding new properties upon managedLedger.getConfig().getProperties().putAll(properties)

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label May 19, 2023
@heesung-sohn
heesung-sohn force-pushed the managedLedgerConfig-Properties-NPE branch from ed1dfe4 to 581833a Compare May 19, 2023 19:41
@heesung-sohn

Copy link
Copy Markdown
Contributor Author

@liangyepianzhou PTAL.

@nodece

nodece commented May 20, 2023

Copy link
Copy Markdown
Member

/pulsarbot rerun-failure-checks

@codecov-commenter

codecov-commenter commented May 20, 2023

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.89%. Comparing base (5d5ec94) to head (581833a).
⚠️ Report is 2543 commits behind head on master.

Files with missing lines Patch % Lines
...pulsar/broker/admin/impl/PersistentTopicsBase.java 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #20361       +/-   ##
=============================================
+ Coverage     37.92%   72.89%   +34.96%     
- Complexity    12694    31857    +19163     
=============================================
  Files          1691     1864      +173     
  Lines        129047   138321     +9274     
  Branches      14070    15173     +1103     
=============================================
+ Hits          48942   100828    +51886     
+ Misses        73777    29482    -44295     
- Partials       6328     8011     +1683     
Flag Coverage Δ
inttests 24.14% <0.00%> (-0.04%) ⬇️
systests 25.00% <0.00%> (-0.19%) ⬇️
unittests 72.17% <0.00%> (+38.71%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...pulsar/broker/admin/impl/PersistentTopicsBase.java 64.29% <0.00%> (+51.65%) ⬆️

... and 1430 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nodece
nodece merged commit aa7decc into apache:master May 20, 2023
liangyepianzhou pushed a commit to streamnative/pulsar-archived that referenced this pull request May 24, 2023
poorbarcode pushed a commit that referenced this pull request May 30, 2023
liangyepianzhou pushed a commit to liangyepianzhou/pulsar that referenced this pull request Oct 19, 2023
liangyepianzhou added a commit to streamnative/pulsar-archived that referenced this pull request Oct 19, 2023
…ties) NPE (apache#20361) (#5932)

(cherry picked from commit aa7decc)

Co-authored-by: Heesung Sohn <103456639+heesung-sn@users.noreply.github.com>
liangyepianzhou added a commit to liangyepianzhou/pulsar that referenced this pull request Oct 24, 2023
…ties) NPE (apache#20361) (apache#5932)

(cherry picked from commit aa7decc)

Co-authored-by: Heesung Sohn <103456639+heesung-sn@users.noreply.github.com>
(cherry picked from commit 5f6ed1b)
liangyepianzhou added a commit to streamnative/pulsar-archived that referenced this pull request Oct 25, 2023
* Topic properties support for update and remove (#5911)

(cherry picked from commit 6d7dfcf)
(cherry picked from commit 6564e6e)

* [fix][broker] managedLedger.getConfig().getProperties().putAll(properties) NPE (apache#20361) (#5932)

(cherry picked from commit aa7decc)

Co-authored-by: Heesung Sohn <103456639+heesung-sn@users.noreply.github.com>
(cherry picked from commit 5f6ed1b)

* Revert gpg and delete useless file

(cherry picked from commit 2739f2c)
liangyepianzhou added a commit to streamnative/pulsar-archived that referenced this pull request Oct 25, 2023
* Topic properties support for update and remove (#5911)

(cherry picked from commit 6d7dfcf)
(cherry picked from commit 6564e6e)

* [fix][broker] managedLedger.getConfig().getProperties().putAll(properties) NPE (apache#20361) (#5932)

(cherry picked from commit aa7decc)

Co-authored-by: Heesung Sohn <103456639+heesung-sn@users.noreply.github.com>
(cherry picked from commit 5f6ed1b)

* Revert gpg and delete useless file

(cherry picked from commit 2739f2c)
liangyepianzhou added a commit to streamnative/pulsar-archived that referenced this pull request Oct 25, 2023
* Topic properties support for update and remove (#5911)

(cherry picked from commit 6d7dfcf)
(cherry picked from commit 6564e6e)

* [fix][broker] managedLedger.getConfig().getProperties().putAll(properties) NPE (apache#20361) (#5932)

(cherry picked from commit aa7decc)

Co-authored-by: Heesung Sohn <103456639+heesung-sn@users.noreply.github.com>
(cherry picked from commit 5f6ed1b)

* Revert gpg and delete useless file

(cherry picked from commit 2739f2c)
liangyepianzhou added a commit to liangyepianzhou/pulsar that referenced this pull request Dec 13, 2023
…ties) NPE (apache#20361) (apache#5932)

(cherry picked from commit aa7decc)

Co-authored-by: Heesung Sohn <103456639+heesung-sn@users.noreply.github.com>
(cherry picked from commit 5f6ed1b)
(cherry picked from commit 8765134)
liangyepianzhou added a commit to streamnative/pulsar-archived that referenced this pull request Dec 13, 2023
* Topic properties support for update and remove (#5911)

(cherry picked from commit 6d7dfcf)
(cherry picked from commit 6564e6e)
(cherry picked from commit bc7ee1a)

* [fix][broker] managedLedger.getConfig().getProperties().putAll(properties) NPE (apache#20361) (#5932)

(cherry picked from commit aa7decc)

Co-authored-by: Heesung Sohn <103456639+heesung-sn@users.noreply.github.com>
(cherry picked from commit 5f6ed1b)
(cherry picked from commit 8765134)

* Revert gpg and delete useless file

(cherry picked from commit 2739f2c)
(cherry picked from commit 73b7c06)
liangyepianzhou added a commit to liangyepianzhou/pulsar that referenced this pull request Dec 14, 2023
…ties) NPE (apache#20361) (apache#5932)

(cherry picked from commit aa7decc)

Co-authored-by: Heesung Sohn <103456639+heesung-sn@users.noreply.github.com>
(cherry picked from commit 5f6ed1b)
(cherry picked from commit 8765134)
(cherry picked from commit f6e3643)
liangyepianzhou added a commit to streamnative/pulsar-archived that referenced this pull request Dec 14, 2023
* Topic properties support for update and remove (#5911)

(cherry picked from commit 6d7dfcf)
(cherry picked from commit 6564e6e)
(cherry picked from commit bc7ee1a)
(cherry picked from commit 403aafe)

* [fix][broker] managedLedger.getConfig().getProperties().putAll(properties) NPE (apache#20361) (#5932)

(cherry picked from commit aa7decc)

Co-authored-by: Heesung Sohn <103456639+heesung-sn@users.noreply.github.com>
(cherry picked from commit 5f6ed1b)
(cherry picked from commit 8765134)
(cherry picked from commit f6e3643)

* Revert gpg and delete useless file

(cherry picked from commit 2739f2c)
(cherry picked from commit 73b7c06)
(cherry picked from commit 2eb4139)
poorbarcode pushed a commit to streamnative/pulsar-archived that referenced this pull request Feb 3, 2024
* Topic properties support for update and remove (#5911)

(cherry picked from commit 6d7dfcf)
(cherry picked from commit 6564e6e)
(cherry picked from commit bc7ee1a)
(cherry picked from commit 403aafe)

* [fix][broker] managedLedger.getConfig().getProperties().putAll(properties) NPE (apache#20361) (#5932)

(cherry picked from commit aa7decc)

Co-authored-by: Heesung Sohn <103456639+heesung-sn@users.noreply.github.com>
(cherry picked from commit 5f6ed1b)
(cherry picked from commit 8765134)
(cherry picked from commit f6e3643)

* Revert gpg and delete useless file

(cherry picked from commit 2739f2c)
(cherry picked from commit 73b7c06)
(cherry picked from commit 2eb4139)
(cherry picked from commit 6bed83b)
liangyepianzhou added a commit to streamnative/pulsar-archived that referenced this pull request Mar 12, 2024
* Topic properties support for update and remove (#5911)

(cherry picked from commit 6d7dfcf)
(cherry picked from commit 6564e6e)
(cherry picked from commit bc7ee1a)
(cherry picked from commit 403aafe)

* [fix][broker] managedLedger.getConfig().getProperties().putAll(properties) NPE (apache#20361) (#5932)

(cherry picked from commit aa7decc)

Co-authored-by: Heesung Sohn <103456639+heesung-sn@users.noreply.github.com>
(cherry picked from commit 5f6ed1b)
(cherry picked from commit 8765134)
(cherry picked from commit f6e3643)

* Revert gpg and delete useless file

(cherry picked from commit 2739f2c)
(cherry picked from commit 73b7c06)
(cherry picked from commit 2eb4139)
(cherry picked from commit 6bed83b)
liangyepianzhou added a commit to streamnative/pulsar-archived that referenced this pull request Mar 12, 2024
* Topic properties support for update and remove (#5911)

(cherry picked from commit 6d7dfcf)
(cherry picked from commit 6564e6e)
(cherry picked from commit bc7ee1a)
(cherry picked from commit 403aafe)

* [fix][broker] managedLedger.getConfig().getProperties().putAll(properties) NPE (apache#20361) (#5932)

(cherry picked from commit aa7decc)

Co-authored-by: Heesung Sohn <103456639+heesung-sn@users.noreply.github.com>
(cherry picked from commit 5f6ed1b)
(cherry picked from commit 8765134)
(cherry picked from commit f6e3643)

* Revert gpg and delete useless file

(cherry picked from commit 2739f2c)
(cherry picked from commit 73b7c06)
(cherry picked from commit 2eb4139)
(cherry picked from commit 6bed83b)
liangyepianzhou added a commit to streamnative/pulsar-archived that referenced this pull request Mar 13, 2024
* Topic properties support for update and remove (#5911)

(cherry picked from commit 6d7dfcf)
(cherry picked from commit 6564e6e)
(cherry picked from commit bc7ee1a)
(cherry picked from commit 403aafe)

* [fix][broker] managedLedger.getConfig().getProperties().putAll(properties) NPE (apache#20361) (#5932)

(cherry picked from commit aa7decc)

Co-authored-by: Heesung Sohn <103456639+heesung-sn@users.noreply.github.com>
(cherry picked from commit 5f6ed1b)
(cherry picked from commit 8765134)
(cherry picked from commit f6e3643)

* Revert gpg and delete useless file

(cherry picked from commit 2739f2c)
(cherry picked from commit 73b7c06)
(cherry picked from commit 2eb4139)
(cherry picked from commit 6bed83b)
liangyepianzhou added a commit to streamnative/pulsar-archived that referenced this pull request Mar 13, 2024
* Topic properties support for update and remove (#5911)

(cherry picked from commit 6d7dfcf)
(cherry picked from commit 6564e6e)
(cherry picked from commit bc7ee1a)
(cherry picked from commit 403aafe)

* [fix][broker] managedLedger.getConfig().getProperties().putAll(properties) NPE (apache#20361) (#5932)

(cherry picked from commit aa7decc)

Co-authored-by: Heesung Sohn <103456639+heesung-sn@users.noreply.github.com>
(cherry picked from commit 5f6ed1b)
(cherry picked from commit 8765134)
(cherry picked from commit f6e3643)

* Revert gpg and delete useless file

(cherry picked from commit 2739f2c)
(cherry picked from commit 73b7c06)
(cherry picked from commit 2eb4139)
(cherry picked from commit 6bed83b)
@heesung-sohn
heesung-sohn deleted the managedLedgerConfig-Properties-NPE branch April 2, 2024 17:45
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Apr 8, 2024
nodece pushed a commit to nodece/pulsar that referenced this pull request May 11, 2024
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.

5 participants