Skip to content

[Fix](job)Reclaim resources held by finished tasks#34506

Merged
CalvinKirs merged 1 commit intoapache:masterfrom
CalvinKirs:master-wenqiang
May 8, 2024
Merged

[Fix](job)Reclaim resources held by finished tasks#34506
CalvinKirs merged 1 commit intoapache:masterfrom
CalvinKirs:master-wenqiang

Conversation

@CalvinKirs
Copy link
Member

Proposed changes

What happened

Failure to explicitly release resources used by completed tasks can cause memory to remain in use until the task is cleared.

Affected versions

2.1.0 +

Changes

add closeOrReleaseResources method

make sure that resources are properly cleaned up when they are no longer needed. This improves code readability and maintains a consistent approach to resource management.

test

Testing on my test cluster

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@CalvinKirs
Copy link
Member Author

run buildall

@CalvinKirs CalvinKirs force-pushed the master-wenqiang branch 2 times, most recently from 83d957a to cdd1c84 Compare May 8, 2024 03:03
closeOrReleaseResources(), which is responsible for safely closing or releasing the stmtExecutor, command, and ctx objects. The method follows a null check pattern to avoid NullPointerExceptions and ensures that resources are properly cleaned up when they are no longer needed. This improves code readability and maintains a consistent approach to resource management.
@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2024

PR approved by anyone and no changes requested.

@CalvinKirs
Copy link
Member Author

run buildall

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label May 8, 2024
@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2024

PR approved by at least one committer and no changes requested.

@CalvinKirs CalvinKirs merged commit ba460b1 into apache:master May 8, 2024
@CalvinKirs CalvinKirs deleted the master-wenqiang branch May 8, 2024 10:42
yiguolei pushed a commit that referenced this pull request May 10, 2024
closeOrReleaseResources(), which is responsible for safely closing or releasing the stmtExecutor, command, and ctx objects. The method follows a null check pattern to avoid NullPointerExceptions and ensures that resources are properly cleaned up when they are no longer needed. This improves code readability and maintains a consistent approach to resource management.
ByteYue pushed a commit to ByteYue/doris that referenced this pull request May 15, 2024
closeOrReleaseResources(), which is responsible for safely closing or releasing the stmtExecutor, command, and ctx objects. The method follows a null check pattern to avoid NullPointerExceptions and ensures that resources are properly cleaned up when they are no longer needed. This improves code readability and maintains a consistent approach to resource management.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/2.1.3-merged dev/3.0.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants