Skip to content

fix source database ownership and isolate session tests - #18745

Closed
kevinushey wants to merge 2 commits into
mainfrom
bugfix/source-database-session-ownership
Closed

kevinushey wants to merge 2 commits into
mainfrom
bugfix/source-database-session-ownership

Conversation

@kevinushey

Copy link
Copy Markdown
Collaborator

Intent

Fixes #18744.

When Desktop starts while Server is running without a project, source database recovery can mistake Server's link-based lock for an unlocked advisory lock and rename the live session's directory. Server then fails to create documents with No such file or directory errors. C++ session tests can also initialize against a developer's real RStudio data directory.

Approach

  • Check both advisory and link-based locks before reclaiming or reusing a source database. Treat advisory inspection errors as locked, and propagate lock contention instead of continuing with another process's database.
  • Give C++ session tests fresh data and configuration directories on Unix and Windows, matching the R test scope. Stop before launching a session if temporary directory creation fails.

Automated Tests

Added five C++ lock regression tests and two Python tests that exercise the configured Unix launcher with stub session executables. The launcher tests also fail against the original script.

Validated on macOS:

  • FileLockingTest.*: 9 tests passed.
  • python3 src/cpp/tests/python/test-test-runner-isolation.py: 2 tests passed.
  • Concurrent Server/Desktop sessions sharing temporary state, in both launch orders: source directories remain intact and actual new_document RPCs succeed.
  • Recovery after either mode's owner exits unexpectedly: the other mode recovers the abandoned documents and creates a document successfully.
  • Competing Server processes resolving to the same session ID: the second source database attachment reports lock contention; the original session continues creating documents.
  • Unix launcher syntax and git diff --check passed.

The modified C++ translation units were rebuilt and relinked with the existing core-test and rsession build artifacts. The full suite and Windows runtime tests were not run locally.

QA Notes

Reproduction and QA scenarios are recorded in #18744. Use temporary RStudio data/configuration directories when testing concurrent sessions and crash recovery.

Documentation

Added a NEWS entry linked to #18744. No user-facing configuration changes.

Checklist

  • Includes an issue-linked NEWS entry.
  • Adds regression coverage and passes the targeted local checks above.
  • CI and Windows validation.
  • Reviewer assigned.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

RStudio E2E - all platforms

All tests passed!

#################### 100% pass rate

Passed Failed Skipped Flaky
2682 0 184 5
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 2 0 10 0
✅ desktop-linux 675 0 38 0
✅ desktop-macos 680 0 33 1
✅ desktop-windows 677 0 39 3
✅ server-linux 620 0 44 1
✅ setup 28 0 20 0
View / download the full report

View report online -- opens in the browser, no download needed. Available for 14 days.

Download playwright-report.zip -- extract and open index.html

Includes screenshots, traces, and step-by-step details for every test. Expires in 15 days.


All platforms - commit 79f04b6180800242f0b1201f418b06b1104e4ef5 - Run #880

This branch was previously deployed

1 inactive deployment
e2e-playwright — 79f04b61 Deployed Sep 9, 2026 by kevinushey via windows / e2e-desktop-windows (2) #880
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.

desktop can reclaim a running server session's source database

2 participants