"Software rugpull" for multi-worker support #4487
Open
+31
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#1539 (reply in thread)
Everything just works.
I make a web request to port 8000 using my custom balancer, which remembers I made an HTTP request to which port (say: 8080), and actively refuses to let me talk to such port in the websocket (picking from 8081, 8082, 8083).
This is why it is beneficial to make your own balancer @rodja 😉
Then, on the page load for async pages, it loads up to the part before await ui.context.client.connected()
Afterwards, the "Software Rugpull" kicks in, and the page is swapped out with what the other process responds with.
For sync pages, the old content also briefly flashes before the new content from the client in the rugpull operation is written to the screen.
Afterwards, the interactivity works properly following the new client.
But, let me also explain how it works. It's fun, really!
When, on handshake, it realizes it just got "cold-called" by a browser whose proclaimed
client_id
in the data doesn't exist, it:client_id
This is enabled by:
await ui.context.client.connected()
do absolutely nothing if the client was spawned in response to a cold callpath
of the page, making it possible to do the reverse lookup in the page route to function dictionaryHonestly it is amazing that it works so well as it stands. I can already forsee some code cleanups.
And also, the args and kwargs of the page are completely neglected as it stands.