Skip to content

Conversation

fredia
Copy link
Contributor

@fredia fredia commented Jun 16, 2021

What is the purpose of the change

This pull request fix resource leak in RocksIncrementalSnapshotStrategy caused by RocksDBStateUploader not being closed.

Brief change log

  • Add close() function to RocksDBSnapshotStrategyBase and RocksIncrementalSnapshotStrategy
  • Add a call to checkpointSnapshotStrategy.close() in RocksDBKeyedStateBackend#dispose()

Verifying this change

This change can be verified as follows:

  • org/apache/flink/contrib/streaming/state/RocksIncrementalCheckpointRescalingTest.java

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

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (yes: Checkpointing)
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)

@flinkbot
Copy link
Collaborator

flinkbot commented Jun 16, 2021

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit 9c82b0a (Sat Aug 28 12:17:22 UTC 2021)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.


The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@flinkbot
Copy link
Collaborator

flinkbot commented Jun 16, 2021

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run travis re-run the last Travis build
  • @flinkbot run azure re-run the last Azure build

Copy link
Contributor

@RocMarshal RocMarshal left a comment

Choose a reason for hiding this comment

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

@fredia Thank you for your contribution. LGTM +1, wait the CI passed.

@fredia
Copy link
Contributor Author

fredia commented Jun 16, 2021

Thank you so much for your review @RocMarshal . Since checkpointSnapshotStrategy is initialized in RocksDBKeyedStateBackendBuilder#build(), but I forgot to close it in the catch statement in RocksDBKeyedStateBackendBuilder#build(), can you re-review it if you got free time?

Copy link
Contributor

@rkhachatryan rkhachatryan left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @fredia, in general LGTM.
I have some minor remarks, PTAL.

Could you please squash the commits and rename it according to
Flink conventions (add jira label, etc.)?

@fredia fredia force-pushed the fix_resource_leak branch 2 times, most recently from 11a8a9c to 7fd6cd6 Compare June 16, 2021 09:26
@fredia
Copy link
Contributor Author

fredia commented Jun 16, 2021

@rkhachatryan Sorry for the irregular naming. I have squashed the commits and renamed them. Can you re-review it if you got free time?

@fredia fredia force-pushed the fix_resource_leak branch from 7fd6cd6 to 9c82b0a Compare June 16, 2021 09:34
Copy link
Contributor

@rkhachatryan rkhachatryan left a comment

Choose a reason for hiding this comment

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

Thanks for updating your PR @fredia, LGTM.

@rkhachatryan rkhachatryan merged commit 8be1058 into apache:master Jun 17, 2021
@fredia fredia deleted the fix_resource_leak branch January 2, 2025 04:54
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.

6 participants