Skip to content

Add signal handler to flush logger on SIGINT/SIGTERM#2474

Merged
stevenengler merged 2 commits intoshadow:mainfrom
valdaarhun:add_signal_handler
Oct 16, 2022
Merged

Add signal handler to flush logger on SIGINT/SIGTERM#2474
stevenengler merged 2 commits intoshadow:mainfrom
valdaarhun:add_signal_handler

Conversation

@valdaarhun
Copy link
Copy Markdown
Contributor

Closes #2188 .

Hi. I am quite new to rust and am trying to learn on the fly. Please do let me know if this PR can be improved.

@github-actions github-actions bot added Component: Build Build/install tools and dependencies Component: Main Composing the core Shadow executable labels Oct 15, 2022
@codecov
Copy link
Copy Markdown

codecov bot commented Oct 15, 2022

Codecov Report

Base: 42.46% // Head: 43.29% // Increases project coverage by +0.82% 🎉

Coverage data is based on head (6fbe4b7) compared to base (f593050).
Patch coverage: 28.57% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2474      +/-   ##
==========================================
+ Coverage   42.46%   43.29%   +0.82%     
==========================================
  Files         180      180              
  Lines       26703    26710       +7     
  Branches     5375     5379       +4     
==========================================
+ Hits        11340    11563     +223     
+ Misses      12735    12482     -253     
- Partials     2628     2665      +37     
Flag Coverage Δ
tests 43.29% <28.57%> (+0.82%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/main/core/main.rs 41.77% <28.57%> (+1.37%) ⬆️
src/main/core/scheduler/pools/unbounded.rs 76.70% <0.00%> (-3.98%) ⬇️
src/lib/tsc/tsc_test.c 31.39% <0.00%> (ø)
src/main/host/descriptor/descriptor_table.rs 81.48% <0.00%> (ø)
src/main/host/memory_manager/memory_mapper.rs 71.63% <0.00%> (+0.20%) ⬆️
src/main/core/scheduler/pools/bounded.rs 81.56% <0.00%> (+0.39%) ⬆️
src/main/utility/interval_map.rs 80.35% <0.00%> (+0.50%) ⬆️
src/lib/shadow-shim-helper-rs/src/signals.rs 74.82% <0.00%> (+0.71%) ⬆️
src/main/host/descriptor/mod.rs 66.88% <0.00%> (+0.87%) ⬆️
src/main/host/memory_manager/mod.rs 79.16% <0.00%> (+0.98%) ⬆️
... and 16 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@stevenengler
Copy link
Copy Markdown
Contributor

stevenengler commented Oct 15, 2022

Thanks, looks great! Can you add an info-level log message before the flush with "Received signal {signal}. Exiting..." or something like that?

@valdaarhun
Copy link
Copy Markdown
Contributor Author

Can you add an info-level log message before the flush

Hi. Sure, will do.

@stevenengler stevenengler merged commit 5442bfb into shadow:main Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Build Build/install tools and dependencies Component: Main Composing the core Shadow executable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add signal handler to flush shadow log on SIGINT

2 participants