Hot Reloading 🌶️🌶️🌶️ #387
No reviewers
Labels
No labels
Bug
Cherry-picking
Database
Dependencies
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/Federation
Matrix/MSC
Matrix/Media
Meta
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Wont fix
old/ci/cd
old/rust
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: continuwuation/continuwuity#387
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "main"
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?
updated docs are now available:
docs/development/hot_reload.md
To enable hot-reloading:
Have patience. Understand this is a fringe mode of operation for the Rust toolchain and its ecosystem, not the beaten path you're used to. Follow these steps and please report any issues.
Use a supporting platform capable of runtime dynamic shared-linking:
✅ ELF/glibc platforms.
❌ ELF/musl - does not support unloading.
❌ Mach/macOS - does not unload in our case (possibly due to specific thread-local complexities).
Uncomment the profile-rustflags in Cargo.toml. This means you need +nightly.
Uncomment the
dylib
crate-type insrc/*/Cargo.toml
anddeps/rust-rocksdb/Cargo.toml
Due to https://github.com/rust-lang/cargo/issues/12746 you will have to export
LD_LIBRARY_PATH
before running to something like:export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/
Run the server and edit code in any
src/
directory other thansrc/core
orsrc/bin
. The deeper the change the harder it is to reload, so try sticking tosrc/router
orsrc/admin
orsrc/api
rather thansrc/service
orsrc/database
.Strike ctrl-c to reload. It might take a moment if your server is under a lot of load. We're working on that too.
To actually shutdown without reloading, strike
ctrl-\
. Note bothctrl-c
andctrl-\
will shutdown normally in release-mode or whenever reloading is disabled.