Skip to content

feat(async-search): fetch fractions one by one to avoid global lock#424

Open
eguguchkin wants to merge 3 commits into
mainfrom
423-single-frac-access
Open

feat(async-search): fetch fractions one by one to avoid global lock#424
eguguchkin wants to merge 3 commits into
mainfrom
423-single-frac-access

Conversation

@eguguchkin
Copy link
Copy Markdown
Collaborator

Fixes #423


  • I have read and followed all requirements in CONTRIBUTING.md;
  • I used LLM/AI assistance to make this pull request;

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 14, 2026

Codecov Report

❌ Patch coverage is 75.40984% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.58%. Comparing base (e0cf437) to head (a5c39f9).

Files with missing lines Patch % Lines
asyncsearcher/async_searcher.go 62.50% 6 Missing and 3 partials ⚠️
fracmanager/fraction_registry.go 83.33% 3 Missing ⚠️
skipmaskmanager/skip_mask_manager.go 75.00% 1 Missing and 1 partial ⚠️
storeapi/grpc_async_search.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #424      +/-   ##
==========================================
- Coverage   70.65%   70.58%   -0.08%     
==========================================
  Files         219      219              
  Lines       16967    16983      +16     
==========================================
- Hits        11988    11987       -1     
- Misses       4084     4098      +14     
- Partials      895      898       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@eguguchkin eguguchkin force-pushed the 423-single-frac-access branch from 5d12ddb to bda808a Compare May 14, 2026 08:33
@eguguchkin eguguchkin requested review from dkharms and forshev May 15, 2026 00:05
@github-actions
Copy link
Copy Markdown
Contributor

🔴 Performance Degradation

Some benchmarks have degraded compared to the previous run.
Click on Show table button to see full list of degraded benchmarks.

Show table
Name Previous Current Ratio Verdict
MutexListAppend-4 e0cf43 edfbf5
218.29 MB/s 196.97 MB/s 0.90 🔴

defer func() { <-smm.rateLimit }()

f, release, ok := fracs.AcquireFraction(fracNameFromFilePath(name))
defer release()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For now, release() is noop, but it will change after merge of #277.
Are you sure that is good idea to release fraction even if it was not found?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

maybe defer release after if !ok check?


func (as *AsyncSearcher) acquireAndProcessFrac(fracInfo fracSearchState, searchInfo asyncSearchInfo, fracs fractionAcquirer) (err error) {
f, release, ok := fracs.AcquireFraction(fracInfo.Name)
defer release()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

defer r.muAll.RUnlock()

f, ok := r.allMap[name]
return f, func() {}, ok
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why it always returns empty function? is it gonna be used later?

defer func() { <-smm.rateLimit }()

f, release, ok := fracs.AcquireFraction(fracNameFromFilePath(name))
defer release()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

maybe defer release after if !ok check?

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.

Async search: adapt to fetch fractions one by one instead of locking all fractions

4 participants