-
Notifications
You must be signed in to change notification settings - Fork 619
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Upgrade to axum 0.7 #7670
Upgrade to axum 0.7 #7670
Conversation
Just a note, I found that the graceful shutdown impl felt a little complex in the example, and wanted to see if tokio-rs/axum#2398 lands quickly enough |
@syphar thanks for that link. it would certainly make this a lot easier... I'm not sure whether that supports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having just gone through this with another project, this LGTM, but I'd be so much happier if we didn't have to do the graceful shutdown dance in our own, non-library code. (Obviously nothing we can do about that right now.)
I think the key here is going to be testing this pretty thoroughly on staging — areas in particular I think we'll want to poke at are behaviour under load and that service restarts still work reliably. (I know this is basically all taken verbatim from the example, and it all reads fine to me, but they're the areas I'm a little nervous about, personally.)
I've tested it on staging using ApacheBench and the numbers didn't look significantly different before/after deploying this branch. The production dyno setup is a bit different to staging, but it looks like performance should be roughly similar to before.
I've used |
This PR upgrades our projects to axum 0.7 and hyper 1.x.
The changes on the axum side are described by https://tokio.rs/blog/2023-11-27-announcing-axum-0-7-0
Unfortunately there appears to be no way to adopt most of these breaking changes incrementally, so this PR has gotten rather large. The three main changes are:
bin/server.rs
is rewritten based on https://github.com/tokio-rs/axum/blob/axum-v0.7.2/examples/graceful-shutdown/src/main.rs and https://github.com/tokio-rs/axum/blob/axum-v0.7.2/examples/serve-with-hyper/src/main.rsB
parameters are removed where necessaryBytesRequest
struct needed to be adjusted, but the test code stayed the same to verify the correctness of the changes