Skip to content

Commit

Permalink
Do not log environment variables passed to kernels (#1437)
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski authored Jul 10, 2024
1 parent 5be0a9a commit 0940671
Showing 1 changed file with 6 additions and 1 deletion.
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

0 comments on commit 0940671

Please sign in to comment.