Skip to content

[improve][broker] Remove locallyAcquiredLock when removeOwnership - #18197

Merged
Technoboy- merged 2 commits into
apache:masterfrom
leizhiyuan:fix/18196
Oct 27, 2022
Merged

Technoboy- merged 2 commits into
apache:masterfrom
leizhiyuan:fix/18196

Conversation

@leizhiyuan

@leizhiyuan leizhiyuan commented Oct 26, 2022 •

Copy link
Copy Markdown
Contributor

Fixes #18196

Master Issue: #18196

Motivation

Modifications

change get to remove

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

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

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

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
  • 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 Oct 26, 2022
@Technoboy- Technoboy- changed the title fix: remove locallyAcquiredLock when removeOwnership [improve][broker] Remove locallyAcquiredLock when removeOwnership Oct 26, 2022
@Technoboy- Technoboy- closed this Oct 26, 2022
@Technoboy- Technoboy- reopened this Oct 26, 2022
@Technoboy- Technoboy- added this to the 2.12.0 milestone Oct 26, 2022
@Technoboy- Technoboy- added type/bug The PR fixed a bug or issue reported a bug area/broker release/2.11.1 release/2.10.3 labels Oct 26, 2022
@Technoboy- Technoboy- closed this Oct 26, 2022
@Technoboy- Technoboy- reopened this Oct 26, 2022
@Technoboy-

Copy link
Copy Markdown
Contributor

Please rebase the branch

*/
public CompletableFuture<Void> removeOwnership(NamespaceBundle bundle) {
ResourceLock<NamespaceEphemeralData> lock = locallyAcquiredLocks.get(bundle);
ResourceLock<NamespaceEphemeralData> lock = locallyAcquiredLocks.remove(bundle);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you please help add a unit test? It will help to avoid any regression for this part.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@leizhiyuan

Copy link
Copy Markdown
Contributor Author

Please rebase the branch

done

@codecov-commenter

codecov-commenter commented Oct 27, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #18197 (9b35de2) into master (6c65ca0) will decrease coverage by 2.73%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #18197      +/-   ##
============================================
- Coverage     34.91%   32.18%   -2.74%     
+ Complexity     5707     4252    -1455     
============================================
  Files           607      398     -209     
  Lines         53396    43548    -9848     
  Branches       5712     4474    -1238     
============================================
- Hits          18644    14014    -4630     
+ Misses        32119    27479    -4640     
+ Partials       2633     2055     -578     
Flag Coverage Δ
unittests 32.18% <0.00%> (-2.74%) ⬇️

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

Impacted Files Coverage Δ
...in/java/org/apache/pulsar/PulsarBrokerStarter.java 0.00% <ø> (ø)
.../org/apache/pulsar/PulsarClusterMetadataSetup.java 0.00% <ø> (ø)
...g/apache/pulsar/PulsarClusterMetadataTeardown.java 0.00% <ø> (ø)
...org/apache/pulsar/PulsarInitialNamespaceSetup.java 0.00% <ø> (ø)
.../main/java/org/apache/pulsar/PulsarStandalone.java 0.00% <0.00%> (ø)
...ava/org/apache/pulsar/PulsarStandaloneBuilder.java 0.00% <ø> (ø)
.../org/apache/pulsar/client/impl/RawMessageImpl.java 0.00% <0.00%> (-93.11%) ⬇️
.../schema/exceptions/InvalidSchemaDataException.java 0.00% <0.00%> (-50.00%) ⬇️
...tent/NonPersistentDispatcherMultipleConsumers.java 0.00% <0.00%> (-48.15%) ⬇️
...apache/pulsar/broker/service/TopicListService.java 10.65% <0.00%> (-44.27%) ⬇️
... and 335 more

@Technoboy-
Technoboy- merged commit b061c6a into apache:master Oct 27, 2022
liangyepianzhou pushed a commit that referenced this pull request Dec 14, 2022
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 10, 2023
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 11, 2023
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.

[Bug] locallyAcquiredLocks leak in OwnershipCache

6 participants