Skip to content

Conversation

ReenigneArcher
Copy link
Member

@ReenigneArcher ReenigneArcher commented Aug 23, 2025

Description

Introduced a ShutdownSignal utility for coordinated shutdown across threads. The web server and tray now support graceful shutdown, with the main function orchestrating thread lifecycles and timeouts. Added dependencies on ctrlc and tokio to support async shutdown handling.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

Copy link

codecov bot commented Aug 23, 2025

Codecov Report

❌ Patch coverage is 81.50685% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.97%. Comparing base (8572e8b) to head (f39dc99).

Files with missing lines Patch % Lines
crates/server/src/tray.rs 20.00% 12 Missing ⚠️
crates/server/src/signal_handler.rs 90.43% 11 Missing ⚠️
crates/server/src/web/mod.rs 75.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #26      +/-   ##
==========================================
+ Coverage   60.70%   66.97%   +6.27%     
==========================================
  Files          14       15       +1     
  Lines         397      539     +142     
==========================================
+ Hits          241      361     +120     
- Misses        156      178      +22     
Flag Coverage Δ
aarch64-apple-darwin 67.16% <80.82%> (+5.99%) ⬆️
aarch64-unknown-linux-gnu 66.79% <80.82%> (+6.08%) ⬆️
x86_64-apple-darwin 67.16% <80.82%> (+5.99%) ⬆️
x86_64-pc-windows-msvc 66.97% <81.50%> (+6.27%) ⬆️
x86_64-unknown-linux-gnu 66.79% <80.82%> (+6.08%) ⬆️

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

Files with missing lines Coverage Δ
crates/server/src/web/mod.rs 83.33% <75.00%> (-3.04%) ⬇️
crates/server/src/signal_handler.rs 90.43% <90.43%> (ø)
crates/server/src/tray.rs 50.00% <20.00%> (-3.34%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ReenigneArcher ReenigneArcher force-pushed the fix/properly-terminate-threads branch 12 times, most recently from 544d343 to d4372f1 Compare August 28, 2025 23:44
Introduces a new signal_handler module providing ShutdownSignal and ShutdownCoordinator for managing graceful shutdown across threads. Refactors main entry point, tray, and web modules to support coordinated shutdown using these primitives. Adds async and sync thread registration, monitoring, and timeout-based forced exit. Includes comprehensive unit and integration tests for shutdown coordination and signal handling.
Replaces the FORCE_EXIT_DISABLED static and related methods with a configurable exit function in ShutdownCoordinator. This enables tests to inject a no-op or custom exit handler, improving testability and removing Windows-specific test logic. Updates all relevant tests to use the new constructor with a mock exit function.
@ReenigneArcher ReenigneArcher force-pushed the fix/properly-terminate-threads branch from b48756b to b1ac6e0 Compare August 29, 2025 00:02
Copy link

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.

1 participant