Skip to content
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

Do not log environment variables passed to kernels #1437

Merged
merged 4 commits into from
Jul 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion jupyter_server/services/kernels/kernelmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,12 @@ async def _async_start_kernel( # type:ignore[override]
kernel.reason = "" # type:ignore[attr-defined]
kernel.last_activity = utcnow() # type:ignore[attr-defined]
self.log.info("Kernel started: %s", kernel_id)
self.log.debug("Kernel args: %r", kwargs)
self.log.debug(
"Kernel args (excluding env): %r", {k: v for k, v in kwargs.items() if k != "env"}
)
env = kwargs.get("env", None)
if env and isinstance(env, dict): # type:ignore[unreachable]
self.log.debug("Kernel argument 'env' passed with: %r", list(env.keys())) # type:ignore[unreachable]

# Increase the metric of number of kernels running
# for the relevant kernel type by 1
Expand Down
Loading