Add exclusive UNIX endpoint ownership#29
Conversation
2a38c9e to
14bcbcb
Compare
Signed-off-by: Samuel Williams <samuel.williams@shopify.com>
14bcbcb to
c9726ba
Compare
|
After working through the intended Falcon cluster use case, I do not think we should merge the exclusive endpoint in its current form. Each worker can use a unique UNIX socket path, so there should be no meaningful ownership contention. xDS is the authoritative source of viable worker endpoints, and graceful shutdown can explicitly unlink the path. A crash may leave stale entries in the directory, but that is unavoidable in the general case and consumers already need to tolerate unavailable sockets or rely on xDS metadata.
The safety improvement that prevents stale-socket recovery from replacing an unrelated filesystem entry may still be worth extracting into a smaller separate PR. |
Summary
IO::Endpoint::ExclusiveUNIXEndpointas a dedicated subclass for UNIX socket path ownership.IO::Endpoint.exclusive_unix(path)as the explicit construction API;IO::Endpoint.unix(path)remains non-owning.unique:for generating an immediately inspectable worker socket path within an existing directory using a prefix, PID, and random entropy.flockfor the socket lifetime so crashed workers release ownership automatically and later workers can recover stale sockets.Async::HTTP::Endpoint.Validation
SIGKILLfor stable and generated socket pathsAsync::HTTP::Endpoint