You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rserver can't tell which session process a request outcome came from, so a predecessor's response can clear a new launch's pending entry #18963
rserver avoids launching the same session twice by keeping a pending-launch entry per session context (src/cpp/server/session/ServerSessionManager.cpp), and it clears that entry when a request for the context succeeds or fails. It can't tell whether the outcome came from the process it just launched or from the one being replaced. A request answered by, or failing on, an exiting predecessor can therefore clear the new launch's entry, and the next request that finds the session unavailable launches it again.
removePendingSessionLaunch(username, sessionId), the variant Workbench calls when forwarding launcher session RPCs, erases the entry unconditionally and ignores both guards.
(Minor) endLaunching() runs only if sessionLaunchFunction_ returns normally. If it throws, the entry keeps launching = true, and relaunches for that context are suppressed until the one-minute pending window expires. A scope guard would fix this.
For server sessions on a local stream, #18944's session-side claim makes a duplicate exit early in startup, so the practical cost there is one wasted process launch. Sessions that don't listen on a local stream (such as Workbench launcher sessions) don't have that backstop.
Possible fix
Only let an outcome from the launched process clear its entry, rather than adding a guard for each window. For example, compare the answering peer's pid (SO_PEERCRED / getpeereid() on the local stream) with the pid recorded for the pending launch, or stamp each launch with a generation that the session echoes back. Either would subsume both the #18572 guard and the launching flag.
Activity
encode the pending launch resolution as an enum
read SO_PEERCRED in one place
don't hang the test stream server when no client connects
note the listener-pid assumption behind peer pid attribution
test that the proxy error handlers attribute outcomes to the peer
put the session proxy tests in the rstudio namespace
attribute session request outcomes to the process that produced them (#…