-
Notifications
You must be signed in to change notification settings - Fork 8
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
Enable WebSocket Affinity in the device agent #213
Conversation
part of FlowFuse/flowfuse#2514 Reuses the affinity cookie if present, shares the affinity cookie with the forge platform if available.
Need to work out how to test this |
I've used the default Cookie name here, we may want to set it to a FF specific value. |
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.
As proposed in https://github.com/FlowFuse/flowfuse/pull/3173/files#r1445027729 - lets use FFSESSION
for the cookie name
lib/editor/tunnel.js
Outdated
socket.on('upgrade', (evt) => { | ||
if (evt.headers && evt.headers['set-cookie']) { | ||
const cookies = evt.headers['set-cookie'] | ||
cookies.forEach(cookie => { |
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.
@hardillb Are we certain that evt.headers['set-cookie']
is always going to be an array? I don't readily have the means to verify this locally.
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.
I'll double check the WS code, but if I can't find a definitive answer I'll add some defensive code
part of FlowFuse/flowfuse#2514
Description
As part of work to enable horizontal scaling of the Forge App, this allows the Device agent to use a cookie to bind to a specific instance (using Nginx Affinity mapping to start with).
Reuses the affinity cookie if present, shares the affinity cookie with the forge platform if available.
Related Issue(s)
FlowFuse/flowfuse#2514
Checklist
flowforge.yml
?FlowFuse/helm
to update ConfigMap TemplateFlowFuse/CloudProject
to update values for Staging/ProductionLabels
backport
labelarea:migration
label