Skip to content

feat(libs): add libs - #1

Merged
ShaunSHamilton merged 1 commit into
mainfrom
feat_libs
Oct 7, 2026
Merged

ShaunSHamilton merged 1 commit into
mainfrom
feat_libs

Conversation

@ShaunSHamilton

@ShaunSHamilton ShaunSHamilton commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

1st in stack

#1
├── #2
├── #3
├── #4
├── #5
├── #6

Comment thread libs/runtime/src/lib.rs
@ShaunSHamilton
ShaunSHamilton added this pull request to stack #7 October 7, 2026 09:07
Comment thread libs/.gitkeep
Comment on lines +24 to +27
/// Bounds on every request to Sentry. Without them an unreachable Sentry holds the process
/// open at exit for the OS TCP connect timeout (minutes), past `docker stop`'s grace period.
const SENTRY_CONNECT_TIMEOUT: Duration = Duration::from_secs(2);
const SENTRY_REQUEST_TIMEOUT: Duration = Duration::from_secs(5);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't feel like you need to explain in detail (pointing me to the docs would be great), but is the shutdown analogous to fastify's? i.e. when you start shutting down new then connections are rejected with a bad status (503, say) and (depending on config) existing connections get killed at some point?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main thing happening here is:

fn main() -> Exit {
    // ...stuff that does not matter
    // `_sentry` guard created
    let _sentry = runtime::telemetry::init(runtime::release!(), &config.telemetry);

    runtime::serve(config.listen_addr, app::app())
    // `_sentry` guard dropped
}

Once _sentry "goes out of scope", the Drop implementation is invoked. If we do not explicitly set Sentry's timeouts, the defaults are used, and this guard is held on for annoyingly long - Docker will force kill, before graceful shutdown.

Refs:


As for your actual question, I am not sure this can be compared to Fastify, because this code is part of the CLIENT.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, thanks. I'm sure this will become clear, but I saw this being used in the server file and so my mind didn't leap to client!

@ShaunSHamilton
ShaunSHamilton merged commit 9d944b1 into main Oct 7, 2026
1 check passed
@ShaunSHamilton
ShaunSHamilton deleted the feat_libs branch October 7, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants