Skip to main content

Module attach

Module attach 

Source
Expand description

The attach sockets of the containers, see the attach socket section of docs/protocols.md: the stdin of the clients towards the container and the container output towards the clients.

Modulesยง

socket ๐Ÿ”’
The attach sockets themselves: accepting the clients, reading their stdin and writing the output to them.

Structsยง

AttachListener ๐Ÿ”’
A listening attach socket and the identity of its file, which tells if the file got removed or replaced meanwhile. The inode stays in use while the listener is open, so its number cannot be reused until then.
AttachOutput ๐Ÿ”’
The container output registered by SharedContainerAttach::output.
ListenerCleanup ๐Ÿ”’
Removes the entry of a listener and its socket however its task ends. Another listener which replaced it took over the path and the entry with an id of its own, which stay. The listener must still be open, see SharedContainerAttach::remove_listener.
Logging ๐Ÿ”’
Output on its way into the log, see SharedContainerAttach::logging.
OutputState ๐Ÿ”’
The output towards the attach clients, shared with the registered output of the container, see SharedContainerAttach::output.
SharedContainerAttach ๐Ÿ”’
A shared container attach abstraction.
StopOutput ๐Ÿ”’
Stops the output of an exec once dropped by the consumer of its output, after the process exited, see SharedContainerAttach::stop_output. Without exit files, the consumer decides when the output is complete: a slow one blocks the read loops, which a stop after a pause of the output would cut off with data left in the pipes. A consumer which went away before the exit takes nothing anymore, the output stops with the exit.

Constantsยง

OUTPUT_CHANNEL_SIZE ๐Ÿ”’
Capacity of the output broadcast channel towards the attach clients. A client which falls further behind than this loses the oldest output, which gets logged with the number of skipped messages, see Lag. The container output never waits for an attach client, a slow or stuck client must not block the container or the other clients, and the server does not buffer output without bound for it either. About what the stdio channels buffer for exec, as a power of two, which tokio rounds the capacity of a broadcast channel up to anyway.
STDIN_CHANNEL_SIZE ๐Ÿ”’
Capacity of the stdin channel towards the container.