Changelog¶
Unreleased¶
Documentation: a Sphinx site of its own (
docs-src/; build withpip install -e . --group docsandpython -m sphinx -W --keep-going -b html docs-src/source docs-src/build/html).try_pyepmd.pybecameexamples/run_epmd.py;requirements.txtis gone. The examples on the pages are files inexamples/that the tests run. The site moves to https://pyrlang.clau.se/epmd/.Packaging moved from
setup.pytopyproject.toml; Python 3.11 or newer.Epmd.start()returns once the server listens (Epmd(port=0)picks a free port, readable as.portafterwards);Epmd.stop()stops listening and closes client connections, and is safe to call twice.start_server()still serves until cancelled.Tests with real Erlang/OTP nodes are the interop suite of
pyrlang, run on this server (pytest --epmd=pythonthere); the tests here need no Erlang.Requests are handled as OTP’s epmd does: one request per connection; malformed, unknown, oversized (body above 3057 bytes) or pipelined requests close the connection without a reply and never raise out of the protocol; a connection without a complete request is closed after
Epmd(packet_timeout=60.0)seconds. A refused ALIVE2_REQ (invalid UTF-8 or longer than 255 characters, name taken) gets result 1 and creation 99; the reply isALIVE2_X_RESPonly to nodes with HighestVersion 6 or more. Closing a refused registration no longer unregisters the node that holds the name.PORT2_RESPends withElen/Extraas registered (it stopped after the name).PORT2_REQdrops one trailing NUL and is closed without a reply for an empty name, a NUL inside it, invalid UTF-8 or more than 255 characters.EpmdNodehasextraandfd.Creation as in OTP’s epmd: a 32-bit counter per name (4..2^32-1, random start) that grows by one each time the name registers again (up to 1000 unregistered names are remembered, and
DUMP_RESPlists them asold/unused name); nodes with HighestVersion below 6 get 1..3. It wasint(time.time()), equal for two registrations within a second and 0 in the 16-bit reply now and then. SeeKNOWN-DIFFERENCES.md.Local-only rules as OTP’s epmd: ALIVE2, DUMP, KILL and STOP are served only to peers on loopback (127.0.0.0/8,
::1, IPv4-mapped) or on the address they connected to; the old check compared strings and raisedTypeErrorfor other peers. KILL_REQ no longer callssys.exit(): it answersOKand stops the server (start_server()returns), but answersNOwhile nodes are registered. STOP_REQ is ignored unless the newEpmd(relaxed_command_check=True); then it also closes the node’s connection, and an unknown name getsNOEXISTSTOPPED, as from OTP.Epmd(max_connections=1024): a client connection over the limit is accepted and closed at once (OTP’s epmd does the same); with the packet timeout this bounds what silent clients can hold.Epmd()listens on IPv4 and IPv6 (was0.0.0.0only); the default ofhostis nowNone. Newaddresses=[...]: those addresses plus the loopback addresses, skipped if a family is missing (OTP’sERL_EPMD_ADDRESSrules). Newpython -m epmd [--port N] [--address A] [--relaxed-command-check] [--packet-timeout S] [--max-connections N], defaulting fromERL_EPMD_PORT,ERL_EPMD_ADDRESS,ERL_EPMD_RELAXED_COMMAND_CHECK.OTP 29 message names:
EpmdProtocol.EPMD_PORT2_REQ;EPMD_PORT_PLEASE2_REQstays as an alias.Tests: a table of hostile and malformed requests over raw sockets (ports of OTP’s
epmd_SUITE), kill/stop rules, creation cycles, a connection flood, andpython -m epmd.NAMES_RESPandDUMP_RESPlist the newest registration first;DUMP_RESPuses OTP’s text (active name <N> at port P, fd = F, NUL after each line).Loggers are named after their modules and no longer set their own level;
EpmdErrorno longer logs when it is created.