Repository navigation
treat EPERM as alive in the pending-launch liveness probe - #18574
Merged
Merged
Conversation
kill(pid, 0) fails with EPERM when the probed process exists but is owned by another user -- exactly what rserver's privilege-dropped request threads see when probing a live rsession on a root-launched multi-user server. The liveness guard from #18573 read that as "not running" and erased the pending-launch record on request errors, so the #18572 double-launch stayed reproducible in precisely the deployment class it targets (dev and e2e servers share a uid with their sessions and were unaffected). Only ESRCH proves absence; count EPERM as alive. Addresses #18572.
kevinushey
temporarily deployed
to
e2e-playwright
August 16, 2026 05:43 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 16, 2026 05:43 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 16, 2026 05:43 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 16, 2026 05:43 — with
GitHub Actions
Inactive
kevinushey
had a problem deploying
to
e2e-playwright
August 16, 2026 05:47 — with
GitHub Actions
Failure
kevinushey
temporarily deployed
to
e2e-playwright
August 16, 2026 05:47 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 16, 2026 05:58 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 16, 2026 05:58 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 16, 2026 05:58 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 16, 2026 05:58 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 16, 2026 05:58 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 16, 2026 05:58 — with
GitHub Actions
Inactive
RStudio E2E - all platforms1 test(s) failed
View / download the full reportView report online -- opens in the browser, no download needed. Available for 14 days. Download playwright-report.zip -- extract and open
All platforms - commit |
3 of 4 tasks
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #18573, which added a liveness guard in
ServerSessionManager::removePendingLaunch: a request error no longer erases the pending-launch record while the launched session process is still alive. The guard probes liveness withcore::system::isProcessRunning, which returnedkill(pid, 0) == 0-- but on a root-launched multi-user server, rserver's request-handling threads run privilege-dropped (temporarilyDropPrivilegesleaves ruid 0 and euidserver-user, and the euid transition clears the effective capability set, so noCAP_KILL), andkill(pid, 0)fails with EPERM for every live rsession owned by another user. The guard read that as "not running", erased the record on the error path exactly as before #18573, and the #18572 double-launch/orphan race remained reproducible in precisely the deployment class it targets. Dev and e2e servers were unaffected (rserver and its sessions share a uid there), which is why #18573's verification passed.isProcessRunningnow counts EPERM as proof the process exists -- only ESRCH means it is gone. That is the established polarity for cross-user liveness probes (psutil'spid_exists: "EPERM clearly means there's a process to deny access to"; moby'sprocess.Aliveon macOS iserr == nil || errors.Is(err, unix.EPERM)), and the #18573 guard is the function's only caller.Verification:
PosixTests.IsProcessRunningDetectsLiveAndDeadProcesses(core) andSessionManagerTest.RequestErrorKeepsPendingLaunchOfOtherUserProcess(rserver). Both probe pid 1, which always exists and is owned by root, so an unprivileged test run exercises the EPERM path (and a privileged one still passes); the new rserver test fails against the previous probe.rstudio-tests --scope core: all pass.--scope rserver: allSessionManagerTestpass; theSqliteDBActiveSessionStorageTestfailures are environmental on this machine and identical on main's build (same as noted on fix rserver double session launch that leaks an orphaned rsession #18573).No NEWS entry: this completes the unreleased #18573 fix, whose #18572 entry already covers the user-facing behavior.
Fixes #18572.