-
Notifications
You must be signed in to change notification settings - Fork 108
Don't leak RUST_LOG into supervisor #8541
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
Merged
Merged
Conversation
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
E2E Tests 🚀 |
sharon-wang
approved these changes
Jul 16, 2025
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.
Python
>>> import os
>>> os.getenv("RUST_LOG")
# nothing returned ✅
R
> Sys.getenv("RUST_LOG")
[1] "warn,ark=warn"
- this looks to be in line with
positron/extensions/positron-r/src/kernel-spec.ts
Lines 36 to 47 in 9026016
// Check the R kernel log level setting const config = vscode.workspace.getConfiguration('positron.r'); const logLevel = config.get<string>('kernel.logLevel') ?? 'warn'; const logLevelForeign = config.get<string>('kernel.logLevelExternal') ?? 'warn'; const userEnv = config.get<object>('kernel.env') ?? {}; const profile = config.get<string>('kernel.profile'); /* eslint-disable */ const env = <Record<string, string>>{ 'RUST_BACKTRACE': '1', 'RUST_LOG': logLevelForeign + ',ark=' + logLevel,
Kernel Supervisor
"kernelSupervisor.logLevel": "error"
2025-07-15 18:10:27.111 [info] Positron Kernel Supervisor activated
2025-07-15 18:10:27.111 [info] 01:10:27 [Positron] Generated connection file path: /var/folders/07/9qwx1rk15rjd0mly1bjwycgc0000gp/T/kallichore-51c34b02-89346.json
2025-07-15 18:10:27.111 [info] 01:10:27 [Positron] Using native IPC transport: unix sockets
2025-07-15 18:10:27.111 [info] 01:10:27 [Positron] Starting Kallichore server /Users/sashimi/dev/positron-dev/extensions/positron-supervisor/resources/kallichore/kcserver with connection file /var/folders/07/9qwx1rk15rjd0mly1bjwycgc0000gp/T/kallichore-51c34b02-89346.json
01:10:30 [Positron] Read domain socket connection information from /var/folders/07/9qwx1rk15rjd0mly1bjwycgc0000gp/T/kallichore-51c34b02-89346.json: /var/folders/07/9qwx1rk15rjd0mly1bjwycgc0000gp/T/kc-89411.sock, constructed base path: http://unix:/var/folders/07/9qwx1rk15rjd0mly1bjwycgc0000gp/T/kc-89411.sock:
01:10:30 [Positron] Kallichore 0.1.51 server online with 0 sessions
01:10:30 [Positron] Running as pid 89411 (terminal pid 89357)
01:10:30 [Positron] Kallichore server started in 2953ms
01:10:30 [Positron] Streaming Kallichore server logs from /var/folders/07/9qwx1rk15rjd0mly1bjwycgc0000gp/T/kallichore-51c34b02-89346.log (log level: error)
01:10:30 [Positron] Creating session: {"sessionId":"r-31d848ad","sessionMode":"console","createdTimestamp":1752628227673,"startReason":"Affiliated R runtime for workspace"}
"kernelSupervisor.logLevel": "info"
...
01:12:21 [INFO] Server set to shut down after 1 hours of inactivity
01:12:22 [INFO] new_session("r-8b94a031") - X-Span-ID: "9e505a79-a5fb-43f3-bc2b-3d1990e7aef6"
01:12:22 [INFO] start_session("r-8b94a031") - X-Span-ID: "fc6b5ec8-5649-4532-827d-872b2a57d1b1"
01:12:22 [INFO] [session r-8b94a031] Kernel supports JEP 66 (protocol version 5.5) - creating registration socket for handshake
01:12:22 [INFO] [session r-8b94a031] Waiting for JEP 66 handshake
...
"kernelSupervisor.logLevel": "trace"
...
01:13:48 [INFO] [session r-ca992a61] Waiting for JEP 66 handshake
01:13:48 [DEBUG] (8) kcserver::kernel_session: End of output stream (kind: Stdout)
01:13:48 [DEBUG] (8) kcserver::kernel_session: End of output stream (kind: Stderr)
01:13:48 [INFO] Received handshake request from kernel
01:13:48 [INFO] [session r-ca992a61] Sending successful handshake reply to kernel
01:13:48 [INFO] [session r-ca992a61] Handshake completed successfully
01:13:48 [INFO] [session r-ca992a61] JEP 66 handshake completed successfully
01:13:48 [TRACE] (8) kcserver::kernel_session: [crates/kcserver/src/kernel_session.rs:715] [session r-ca992a61] Waiting for kernel sockets to connect
...
Pulling in main should resolve the unit test failure! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This change removes the
RUST_LOG
environment variable from the kernel supervisor's environment. It is (now) unnecessary since we already use a command-line argument to set the log level, and because kernels inherit the supervisor's environment, it can affect the log level of Rust-based programs invoked from the kernels (such as uv).Addresses #8538.
Release Notes
New Features
Bug Fixes
RUST_LOG
environment variable from R and Python sessionsQA Notes
RUST_LOG
manually via e.g. the Environment Variables featureRUST_LOG
as well, so you'll see that value in R sessionsRUST_LOG
no longer being overridden, is that the kernel's log level setting still works