-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Checklist #1
Comments
OK, as for graceful shutdown, it looks like the story goes something like this, courtesy of the tokio docs topic:
|
Hmm, so then I sort of need to decide who's allowed to spawn tasks, in terms of separation of concerns. I want the token and session DB helpers to be able to spawn fire-and-forget writes in their authenticate paths, because that unblocks the read portion from waiting on the writer thread... but I don't think I want the DB helpers to own the long-lived periodic session purging job. Yeah, moving the async-last-used-update part out of the db helpers would make them way too annoying, so db definitely needs access to the task tracker. I think it doesn't need cancellation though? |
As described in the comments to #1, and following the guidance from https://tokio.rs/tokio/topics/shutdown: - Use a CancellationToken to signal long-running tasks to wrap up their business. - Use a central TaskTracker to spawn any tasks that might need time to finish up. - Listen to external signals in one spot, then translate them to a `.cancel()` that everyone else can listen for. - Await all relevant futures before exiting. In our case, that's 1. the main serve loop, and 2. `tracker.close(); tracker.wait().await;`.
An unanswered question: Hey, why does the "real" stdout of the fastcgi server get routed into apache's error_log on my local playground, but NOT on dreamhost? Ok, so this has always been the case:
OK yup, gdi, the answer's right in front of me: And, that confirms that I need to roll my own app log appender rather than figuring out how to log to apache logs. lol, at least I wasn't setting RUST_LOG=trace on my soak test. |
shit dude, I think we've done it |
PRAGMA temp_store = memory;
(set it in the connect opts)Implement routes
✅ all done!
Port route tests
✅ all done!
Downhill
instrument
on route handlers withoutskip_all
was cramming the dogstate into span attrs, and we're several spans deep when a sqlx::query debug event occurs.)The text was updated successfully, but these errors were encountered: