Skip to content
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

Handle SIGINT #434

Merged
merged 1 commit into from Dec 4, 2023
Merged

Handle SIGINT #434

merged 1 commit into from Dec 4, 2023

Conversation

aaronmondal
Copy link
Contributor

@aaronmondal aaronmondal commented Dec 1, 2023

This allows Ctrl+c killing the cas executable in environments that don't invoke the it via a shell wrapper. This is the case in, for instance, minimal container images.


This change is Reviewable

Copy link
Collaborator

@allada allada left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @aaronmondal)


src/bin/cas.rs line 655 at r1 (raw file):

    let runtime = tokio::runtime::Builder::new_multi_thread()
        .enable_all()
        .on_thread_start(move || set_metrics_enabled_for_this_thread(metrics_enabled))

Can't change this. This function gets ran on every thread that tokio spawns. We need to use this form of tokio runtime creation.

@aaronmondal aaronmondal force-pushed the handle-sigint branch 2 times, most recently from 4fed68a to 81dbc1c Compare December 1, 2023 16:43
Copy link
Contributor Author

@aaronmondal aaronmondal left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @allada)


src/bin/cas.rs line 655 at r1 (raw file):

Previously, allada (Nathan (Blaise) Bruer) wrote…

Can't change this. This function gets ran on every thread that tokio spawns. We need to use this form of tokio runtime creation.

Done.

Copy link
Collaborator

@allada allada left a comment

Choose a reason for hiding this comment

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

Sorry, in my head I thought I approved it so I was ignoring it.

:lgtm:

Reviewed 2 of 3 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @aaronmondal)

This allows Ctrl+c killing the cas executable in environments that don't
invoke the it via a shell wrapper. This is the case in, for instance,
minimal container images.
@aaronmondal aaronmondal merged commit f9e537c into TraceMachina:main Dec 4, 2023
14 of 15 checks passed
@aaronmondal aaronmondal mentioned this pull request Dec 7, 2023
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.

None yet

2 participants