Repository navigation
The crate moves to dynoxide-rs 4.1.0. server::bind is new, and
server::start now refuses a fixed port that a listener holds on the other
loopback family, so it's a minor rather than a patch. Everything else a user
installs carries 1.8.0.
Behaviour changes
- A taken
--portonserveorimport --serveexits4instead of
1. A script that checks for a non-zero exit is unaffected; one that
checks for exactly1needs to accept4too.mcp --httpstill exits1. --mcp-portcan't be the same as a fixed--port. With--mcp,
serveandimport --serveexit1before binding anything when the two
match, whatever the hosts. On macOS, an MCP listener on127.0.0.1could
bind beside DynamoDB on0.0.0.0and take the loopback requests meant for
it. The default--mcp-portcounts, soserve --port 19280 --mcpand
import --serve --port 8100 --mcpnow need--mcp-portset to another
port. So does DynamoDB on127.0.0.1with MCP on[::1]on one port,
which used to work.
(#355)- A listener on the other loopback family now counts as a taken port.
dynoxide --port 8000refuses to start when something listens on
[::1]:8000, and--host '[::1]'refuses when something listens on
127.0.0.1:8000, because alocalhostclient may reach that listener
first. Before, Dynoxide started beside it. The check is in the library, so
server::startin thedynoxide-rscrate refuses in the same way. - The ports are bound before the database is touched or an import runs.
serveandmcp --httpbind them before they create or open the
--db-pathfile, andimport --servebefore it imports. A port that was
taken or couldn't be bound used to leave a new database file behind, or
turn up only after a full import. A client that connects before the server
is ready now waits instead of being refused. With--mcp, the "Starting
DynamoDB HTTP server" line now comes after the binds, so a bind that
fails prints its error without it. - The
dynoxide-rscrate needs tokio 1.46 or later, up from any 1.x.
Starting DynamoDB and MCP together usesjoin!withbiased;, which
arrived in 1.46. A project that pins an older tokio has to move up.
Added
dynoxide serveexits4when its--portis already taken. Every
startup failure used to exit1, so a launcher could only spot a taken port
from the stderr wording, which differed between the pre-bind check, the bind
itself and Windows. Now a listener on the port and a bind that fails because
the port is in use both exit4, with the sameport N is already in use
message. A permission error, such as a privileged port or a port in a range
Windows has reserved, still exits1; on Windows the message says how to
list the reserved ranges.docs/launcher.mdmoves to launcher contract 2 to
cover it.- npm
start()takes aportoption. It defaults to 0, so the operating
system picks a free port as before. A fixed port is for dev setups where
something needs the endpoint in advance, such as a second app or an.env
file. If that port is taken,start()rejects withDYNOXIDE_PORT_IN_USE,
naming the port in the message and inerr.port. An invalid port ("8000",-1,70000) makesstart()
reject with aTypeErrororRangeErrorbefore anything is run. server::bindin thedynoxide-rscrate. It binds a listener with the
checksserver::startmakes: it refuses a port another listener answers
on, and binds exclusively on Windows. Hand the listener to
server::serve_with_shutdownto serve it until your own shutdown future
resolves. (#257)
Fixed
- An MCP port that can't be bound now stops startup. With
serve --mcp
orimport --serve --mcp, Dynoxide used to start DynamoDB and serve, and
only report the MCP bind error (exit1) when it was stopped. Both
listeners are now bound before either serves, so it exits1straight
away, before the ready line or the "Dynoxide listening on" line. Two
--mcpinstances on one machine each need their own--mcp-port, since
they'd otherwise both take the default (19280 forserve, 8100 for
import --serve). An--mcp-portthe same as a fixed--portis now
refused, as set out under Behaviour changes.
(#354,
#355) - A stderr nobody reads no longer costs the exit status. Writing to
stderr once its reader had gone made the release build abort, so a launcher
that had closed the pipe saw a crash instead of the status it was waiting
for, such as4for a taken port. Dynoxide now ignores a failed write to
stderr, the import report included.
(#324) importruns in a debug build without either server. A debug build
withimportbut withouthttp-serverormcp-serverpanicked in one of
clap's checks as soon asimportran. Release builds skip that check.
(#314)