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

Add cookies from http session to web socket used by JupyterCodeExecutor #3312

Merged
merged 5 commits into from
Sep 25, 2024

Conversation

timrbula
Copy link
Contributor

@timrbula timrbula commented Aug 6, 2024

Why are these changes needed?

As noted in the below issue session affinity doesn't work as expected in a Kubernetes environment if the cookies aren't shared between the http and wss requests. AutoGen is likely to try to establish a WS connection with a kernel that was created in a different pod.

Related issue number

Closes #3311

Checks

@WaelKarkoub
Copy link
Contributor

Thanks for the fix! Any way to add a test to "replicate" the error you saw with Kubernetes? Even a mock is good enough

@timrbula timrbula changed the title feat: add cookies from http session to ws Add cookies from http session to web socket used by JupyterCodeExecutor Aug 9, 2024
@timrbula
Copy link
Contributor Author

timrbula commented Aug 9, 2024

Thanks for the fix! Any way to add a test to "replicate" the error you saw with Kubernetes? Even a mock is good enough

Thanks! In regards to testing, I think JupyterClient unit tests would be the easiest approach, though I don't see any explicit tests for that class. We could mock the Jupyter gateway server response to include the set-cookie headers and make sure the WS use them. The problem stated more broadly is about sessions, not specifically Kubernetes. There could be other situations, e.g. auth, where the current implementation would cause problems as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Kubernetes session affinity not working with remote Jupyter code executor deployment
3 participants