A restart does not re-read the log configuration, and a second server cannot be built in one process #113
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
M9 named both and left them: a restart rebuilds the server in-process the way upstream's own loop does rather than exec-ing a new one, so
logis the one configuration section a restart does not re-read — an operator who raises the log level and restarts from the dashboard gets the old level back. The subscriber is a process-wide global, which is also why a second install in one process fails.Two ways out, and the choice is the issue: exec a fresh process on restart (upstream's behaviour is closer to this and it makes the whole configuration re-read trivially correct), or make the subscriber reloadable so the global stops being one. The second is more work and keeps the fast in-process restart that was measured at half a second.
The second install case is not academic — it is what a test that wants two servers in one process needs, and it is why the restart path currently cannot be tested that way.
Where to start
crates/jellyfin-server/src/main.rs:59documents the restart as it stands — theloop re-reads the configuration file and rebuilds every adapter from it — and
crates/jellyfin-server/src/logging.rsis the exception, because the subscriberis a process-wide global that can only be installed once.
The choice is the issue, and it should be made explicitly rather than
discovered:
section re-read correct by construction, and costs the half-second in-process
restart that M9 measured.
root). More work, keeps the fast restart, and is also what unblocks the second
half of this issue — two servers in one process, which is what a test of the
restart path needs and cannot have today.
How to know it is done
Raise the log level in the configuration, restart from the dashboard button, and
see the new level take effect — measured from the log, not asserted. And a test
that builds two servers in one process without the second failing.
House rules
CLAUDE.mdis the short version and these are the parts that bite: tests rununder
cargo nextest; upstream's source is the checkout inupstream/at thepin (
v12.0-rc5,6d501ba4) and not the clone beside the repository;generated files are regenerated rather than edited; a comment says what the code
does, not how it got there; and
Dnreferences stay out of code and comments.ARCHITECTURE.mddecides which crate a thing goes in and which dependency edgesare illegal,
DECISIONS.mdsays why a rule exists.The reference pair is
cargo xtask reference up(andreference provision,which is idempotent); a run is
cargo run -p jellyfin-harness -- replay --upstream URL --ours URL --scenario FILE --out DIR,with
diff-dbfor the two databases.crates/jellyfin-harness/README.mdsayswhat a diff means and what an ignore entry has to carry — every entry needs a
reason and an expiry milestone, and an adds-only history is the smell the risk
table names.