Skip to content

[Java] Add decorator for synchronized CuVSResource access#1209

Merged
rapids-bot[bot] merged 3 commits intorapidsai:branch-25.10from
ldematte:java/thread-lock-on-resource-access
Aug 5, 2025
Merged

[Java] Add decorator for synchronized CuVSResource access#1209
rapids-bot[bot] merged 3 commits intorapidsai:branch-25.10from
ldematte:java/thread-lock-on-resource-access

Conversation

@ldematte
Copy link
Copy Markdown
Contributor

@ldematte ldematte commented Aug 4, 2025

As a follow up to #1089 and #1082, this PR introduces a decorator to ensure that access to a shared CuVSResource is synchronized. This could be useful in cases where application logic is complex and it's not easy to efficiently and cleanly guarantee that access to a CuVSResources is done by at most one thread at each given time.

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Aug 4, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@cjnolet cjnolet added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Aug 4, 2025
@mythrocks
Copy link
Copy Markdown
Contributor

/ok to test 2b2f0cd

if (firstError.get() == null) {
firstError.set(e);
// Start all threads simultaneously to maximize contention
log.info("Starting all {} threads simultaneously...", numThreads);
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.

Not a problem for this PR here. But I would like the tests to run without noise on the screen. We've done this, to a degree, in the TieredIndex tests.

This test is far less noisy than some of the other (extant) ones. We'll address that separately.

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.

++ to review logging levels. Probably a bit of "info" level feedback is OK, but most statements should probably be debug or trace, so we can turn them on when needed.

Copy link
Copy Markdown
Contributor

@mythrocks mythrocks left a comment

Choose a reason for hiding this comment

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

LGTM!

@mythrocks
Copy link
Copy Markdown
Contributor

/ok to test d043cf8

@mythrocks
Copy link
Copy Markdown
Contributor

/merge

@rapids-bot rapids-bot Bot merged commit c22b777 into rapidsai:branch-25.10 Aug 5, 2025
53 checks passed
lowener pushed a commit to lowener/cuvs that referenced this pull request Aug 11, 2025
)

As a follow up to rapidsai#1089 and rapidsai#1082, this PR introduces a decorator to ensure that access to a shared CuVSResource is synchronized. This could be useful in cases where application logic is complex and it's not easy to efficiently and cleanly guarantee that access to a CuVSResources is done by at most one thread at each given time.

Authors:
  - Lorenzo Dematté (https://github.com/ldematte)
  - MithunR (https://github.com/mythrocks)

Approvers:
  - MithunR (https://github.com/mythrocks)

URL: rapidsai#1209
enp1s0 pushed a commit to enp1s0/cuvs that referenced this pull request Aug 22, 2025
)

As a follow up to rapidsai#1089 and rapidsai#1082, this PR introduces a decorator to ensure that access to a shared CuVSResource is synchronized. This could be useful in cases where application logic is complex and it's not easy to efficiently and cleanly guarantee that access to a CuVSResources is done by at most one thread at each given time.

Authors:
  - Lorenzo Dematté (https://github.com/ldematte)
  - MithunR (https://github.com/mythrocks)

Approvers:
  - MithunR (https://github.com/mythrocks)

URL: rapidsai#1209
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants