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

feat: allow connecting to a running kernel from a different browser #792

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion solara/server/kernel_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def initialize_virtual_kernel(session_id: str, kernel_id: str, websocket: websoc
if kernel_id in contexts:
logger.info("reusing virtual kernel: %s", kernel_id)
context = contexts[kernel_id]
if context.session_id != session_id:
if solara.server.settings.kernel.session_check and context.session_id != session_id:
logger.critical("Session id mismatch when reusing kernel (hack attempt?): %s != %s", context.session_id, session_id)
websocket.send_text("Session id mismatch when reusing kernel (hack attempt?)")
# to avoid very fast reconnects (we are in a thread anyway)
Expand Down
1 change: 1 addition & 0 deletions solara/server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class Kernel(BaseSettings):
cull_timeout: str = "24h"
max_count: Optional[int] = None
threaded: bool = solara.util.has_threads
session_check: bool = True

class Config:
env_prefix = "solara_kernel_"
Expand Down
Loading