Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Optimize delete asset memory usage #85

Merged
merged 4 commits into from
Sep 30, 2024

Conversation

sumslim
Copy link

@sumslim sumslim commented Sep 24, 2024

As part of issue: #81
Optimizing memory usage for cancelFn is delete asset from ES using
Cancel function within the context timeout:
After the specified timeout, the context for the task automatically expires, and the cancellation function is invoked.

@sumslim
Copy link
Author

sumslim commented Sep 24, 2024

Test case failing due to race condition detected, possibly due to an edge case:
We need to ensure that no operation modifies cancelFnList between appending a cancel function and calling removeCancelFnByIndex. Might need to use mutex to synchronize access to the cancelFnList, but this might bring contention overhead
Using sync.Map as an alternative as it is supposed to provide better performance under high contention
cc @haveiss @irainia

@coveralls
Copy link

coveralls commented Sep 25, 2024

Pull Request Test Coverage Report for Build 11070490716

Details

  • 10 of 14 (71.43%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.04%) to 84.116%

Changes Missing Coverage Covered Lines Changed/Added Lines %
core/asset/service.go 10 14 71.43%
Totals Coverage Status
Change from base Build 10676380823: -0.04%
Covered Lines: 6911
Relevant Lines: 8216

💛 - Coveralls

Copy link

@irainia irainia left a comment

Choose a reason for hiding this comment

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

Let me know if a separate discussion is required

core/asset/service.go Outdated Show resolved Hide resolved
core/asset/service.go Outdated Show resolved Hide resolved
Copy link

@irainia irainia left a comment

Choose a reason for hiding this comment

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

LGTM! Please don't forget to test. Approving it.

@sumslim sumslim merged commit f2972f1 into main Sep 30, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants