Skip to content

domain_socket datatype requires unix:/local: prefix and trailing :0 #83

Description

@lukebakken

The domain_socket datatype (added for Unix domain socket listener support in RabbitMQ) requires config values in the form:

unix:/var/run/app.sock:0

i.e. a unix: or local: prefix and a trailing :0. A bare path (/var/run/app.sock) is rejected.

Two things drive this, both in cuttlefish_datatypes.erl:

  1. validate_uds/1 keys on the unix:/local: prefix to disambiguate a socket path from an IP address, because a datatype union like [integer, ip, domain_socket] tries each converter in order and a bare path cannot be positively identified as a socket.
  2. from_string/2 reuses the shared address:port splitting (string:rchr(String, $:)), so a :port component must be present even though a Unix domain socket has no port — only :0 is accepted.

The prefix requirement is a reasonable disambiguation strategy, but the mandatory :0 is a surprising artifact of reusing the IP/port parser. It would be nicer to accept a bare prefixed path (unix:/var/run/app.sock) and default the port to 0.

I'm a maintainer here and intend to address this.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions