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

Graceful shutdown #287

Merged

Conversation

Modularius
Copy link
Contributor

Summary of changes

Detects a SIGINT signal from the OS and performs a graceful shutdown.

trace-to-events and digitiser-aggregator

For trace-to-events and digitiser-aggregator, both the producer thread, and the main thread listens for SIGINT.

  • When the producer thread hears it, it closes the MPSC channel and flushes all messages (eventlists and frames respectively) before terminating the thread.
  • When the main-thread hears it, it waits for the producer thread to end, then terminates.

nexus writer

When the signal is received, the main (and only) thread blocks, moves any nxs files in the move_cache queue, then terminates.

Instruction for review/testing

General code review.

Tested on simulated data.

Closes #270.

@Modularius Modularius requested a review from DanNixon December 11, 2024 14:18
common/src/lib.rs Outdated Show resolved Hide resolved
@Modularius Modularius requested a review from DanNixon December 12, 2024 23:37
@DanNixon DanNixon merged commit 5d98c33 into STFC-ICD-Research-and-Design:main Dec 13, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Ensure pipeline components can be terminated and exit cleanly
2 participants