Repository navigation
show the R version in the console pane at startup - #18858
Merged
Merged
Conversation
The Console pane's interpreter label was created reading "(unknown)" and only picked up the real version once the get_rversion_info RPC answered. During startup that RPC waits behind whatever R is busy with, so the placeholder is what users see for the first seconds of a session. Session info already carries the same value (r_versions_info.r_version, from module_context::rVersion()), so seed the label from it and let the RPC refresh it -- which still covers a restart into a different R.
RStudio E2E - all platformsAll tests passed!
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 |
This was referenced Sep 17, 2026
Restart R silently skips its completion event when the session takes more than ~10s to answer
#18870
Closed
kevinushey
added a commit
that referenced
this pull request
Sep 18, 2026
* wait for a slow restart to answer before giving up on it SessionOpener.sendPing ticked every 200ms and spent one of its 50 retries on every tick, including ticks where a ping was already in flight and nothing was sent. The budget was therefore ~10.2s of wall clock however many pings were actually attempted, and when it ran out the loop marked itself completed -- so the ping that did answer a moment later was discarded by the completed_ guard and ConsoleRestartRCompletedEvent never fired. A ping can stay unanswered for much longer than that: rserver holds an RPC aimed at a session it is still relaunching, and the new session then has to restore the workspace before it services RPCs. A failed ping ended the wait outright too, so the retry that would have reached the new session was never sent. That half dates to #17906, which made onCompleted fire exactly once but also made the first failure terminal, leaving maxRetries unused. Budget the wait in wall-clock time instead (60s), wait for an outstanding ping rather than spending the budget on ticks that send nothing, retry after a failure, and announce the restart whenever a ping answers -- even if the wait already timed out, since an answer means R really is back. onCompleted still runs exactly once. Without the event, Shell leaves the console unfocused with a stale prompt and the Console pane keeps showing the previous R version. The e2e test added in #18858 hit this on Server, where a restart takes 9-11s; it no longer needs to hold the completion ping to keep the event alive. Addresses #18870. * bound how late a timed-out restart ping may announce A ping that answers after the timeout still announces the restart, but only within a 5s grace period: announcing refocuses the console, which would otherwise pull the user away arbitrarily late. Also drop the restartAnnounced_ guard, which one-ping-at-a-time already made unreachable. Addresses #18870.
This branch was successfully 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.
Intent
Fixes #18857.
Show the Console pane's R version as soon as session info is available, without waiting for an RPC queued behind R startup work.
Approach
Session.withSessionInfo(): invoke the callback immediately when session info exists, otherwise register a one-timeSessionInitEventhandler and remove it before invoking the callback.Validation
SessionTestspassed, covering immediate callbacks, deferred callbacks, and listener removal.