-
Notifications
You must be signed in to change notification settings - Fork 376
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
trf: Add client traffic management to the CLI #3959
base: master
Are you sure you want to change the base?
Commits on Jul 17, 2023
-
Configuration menu - View commit details
-
Copy full SHA for c418c13 - Browse repository at this point
Copy the full SHA c418c13View commit details -
smug: Pass file descriptors from mgt to cache
The new smuggling facility allows mgt to abuse the heritage process and sneak file descriptors to the cache process via a socket pair. This new trade route will allow the cache to escape its jail and get privileged file descriptors anyway. The smuggler's fence is hidden in plain sight, in the heritage facility, which explains such a smug attitude. Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 3800c05 - Browse repository at this point
Copy the full SHA 3800c05View commit details -
It will be used by the file descriptor smuggler to pass nonces for listen sockets.
Configuration menu - View commit details
-
Copy full SHA for 79e6d50 - Browse repository at this point
Copy the full SHA 79e6d50View commit details -
Configuration menu - View commit details
-
Copy full SHA for dfe0fb2 - Browse repository at this point
Copy the full SHA dfe0fb2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 35e8c04 - Browse repository at this point
Copy the full SHA 35e8c04View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6b20814 - Browse repository at this point
Copy the full SHA 6b20814View commit details -
vca: Join the listen socket smuggling ring
We use the Traffic VSM segment to pass the nonces to the cache process, and this how they synchronize in case of partial success. Though not likely during startup, it is still possible to fail the transfer of a file descriptor, for example when running into a limit. It will become less unlikely once this may happen at any point of the cache run time.
Configuration menu - View commit details
-
Copy full SHA for 1c261bf - Browse repository at this point
Copy the full SHA 1c261bfView commit details -
trf: Add client traffic management to the CLI
The interface offered for operations is a set of traffic.accept, traffic.refuse and traffic.status commands with similar semantics as start, stop and status. The child process will eventually listen to the traffic.start and traffic.refuse commands, but for now only a pseudo accept_traffic parameter is added in struct params. It will be used when tasks running on worker threads reach certain points to decide whether to keep processing requests or not.
Configuration menu - View commit details
-
Copy full SHA for 6e84b57 - Browse repository at this point
Copy the full SHA 6e84b57View commit details -
Configuration menu - View commit details
-
Copy full SHA for f012451 - Browse repository at this point
Copy the full SHA f012451View commit details -
Configuration menu - View commit details
-
Copy full SHA for 794b865 - Browse repository at this point
Copy the full SHA 794b865View commit details -
Configuration menu - View commit details
-
Copy full SHA for b76e439 - Browse repository at this point
Copy the full SHA b76e439View commit details -
It will be used internally to interrupt blocking accept(2) calls.
Configuration menu - View commit details
-
Copy full SHA for 24b1769 - Browse repository at this point
Copy the full SHA 24b1769View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7a304ea - Browse repository at this point
Copy the full SHA 7a304eaView commit details -
vca: Honor traffic.status by closing listen sockets
The accept tasks pool themselves in order to later block on the pool_accepting variable. There could be a more efficient scheduling policy, but once we stop accepting new traffic the workload will mechanically wind down and having one worker per pool per listen socket stuck in a sleep loop ought to be an acceptable trade off, just like during the cache startup. This is triggered by MGT via the cache's CLI, using the same traffic management commands. When the acceptor shutdown is triggered, worker threads tracked as busy accepting new connections are signaled with the no-op SIGUSR1. The CLI thread waits for the last busy worker to signal that nothing else is using the listen sockets, so they can be closed safely, getting rid of an unfortunate race condition.
Configuration menu - View commit details
-
Copy full SHA for 0c3b47e - Browse repository at this point
Copy the full SHA 0c3b47eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3b286ff - Browse repository at this point
Copy the full SHA 3b286ffView commit details -
h2: Honor traffic.status with GOAWAY frame
Stop accepting new streams but allow ongoing transactions to complete gracefully. Since this is an error condition that allows the rx loop to continue, avoid sending a GOAWAY frame more than once.
Configuration menu - View commit details
-
Copy full SHA for 8f4291f - Browse repository at this point
Copy the full SHA 8f4291fView commit details -
Configuration menu - View commit details
-
Copy full SHA for e49b3e7 - Browse repository at this point
Copy the full SHA e49b3e7View commit details -
http1: Honor traffic.refuse with a minimal 503
Otherwise it leads to this sequence of events: - client sends request - request proceeds - client triggers timeout_linger - client session enters waiter - traffic.refuse - client sends request - client session leaves the waiter - request proceeds The last step is the one traffic.refuse is supposed to prevent.
Configuration menu - View commit details
-
Copy full SHA for 907bd61 - Browse repository at this point
Copy the full SHA 907bd61View commit details -
Configuration menu - View commit details
-
Copy full SHA for fc424e8 - Browse repository at this point
Copy the full SHA fc424e8View commit details