-
Notifications
You must be signed in to change notification settings - Fork 132
Fix cleanup of R sessions #10933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix cleanup of R sessions #10933
Conversation
|
E2E Tests 🚀 |
4ebf876 to
baf0589
Compare
| const session = sessions.find(s => s.metadata.sessionId === sessionId); | ||
| if (!session) { | ||
| // The foreground session is for another language. | ||
| // The foreground session is for another language or was deactivated in the meantime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of the await, the session might no longer exist.
| } | ||
|
|
||
| this._lastForegroundSessionId = session.metadata.sessionId; | ||
| await this.activateConsoleSession(session, 'foreground session changed'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like multiple activateConsoleSession() might run concurrently if the didChangeForegroundSession event fires rapidly. We might want to queue the handling.
26a6c1a to
d87869a
Compare
| await vscode.commands.executeCommand('_extensionTests.setLogLevel', 'trace'); | ||
| // Set global Positron log level to debug on CI for easier debugging | ||
| if (process.env.CI) { | ||
| await vscode.commands.executeCommand('_extensionTests.setLogLevel', 'debug'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think trace was nice?
Progress towards #10121
Logs involving the session manager are a bit confusing because sessions are never cleaned up, and so the manager keeps trying to deactivate LSP in sessions that no longer exist. This also causes it hold onto
RSessionobjects, preventing garbage collection.To fix this:
RSessiongains aregister()method for external resources that should be cleaned up when the session is disposed of.RSession, instead of the singleton's own disposables.Release Notes
New Features
Bug Fixes
QA Notes
@:ark