nemo_rl.distributed.held_port#

Module Contents#

Classes#

HeldPortReservation

Bind-and-hold port reservation with fd handoff to a same-node process.

RemoteHeldPortReservation

Functions#

_held_port_uds_name

Abstract-namespace Unix socket where a HeldPortReservation serves its fd.

receive_held_socket

Adopt the listening socket held by this node’s HeldPortReservation.

API#

nemo_rl.distributed.held_port._held_port_uds_name(port: int) str#

Abstract-namespace Unix socket where a HeldPortReservation serves its fd.

nemo_rl.distributed.held_port.receive_held_socket(port: int) socket.socket#

Adopt the listening socket held by this node’s HeldPortReservation.

Parameters:

port – The reserved port; names the same-node handoff endpoint.

Returns:

The live listening socket, duplicated into this process.

class nemo_rl.distributed.held_port.HeldPortReservation#

Bind-and-hold port reservation with fd handoff to a same-node process.

The listening socket stays open from reservation until the eventual server adopts it, so there is zero gap in which the kernel could hand the port to anyone else.

Initialization

address() tuple[str, int]#

Return (node_ip, held_port).

_serve_fd_once() None#
class nemo_rl.distributed.held_port.RemoteHeldPortReservation#

Bases: nemo_rl.distributed.held_port.HeldPortReservation