Skip to content

Conversation

@fcostaoliveira
Copy link
Collaborator

This PR implements proper SIGINT (Ctrl+C) signal handling for memtier_benchmark, allowing users to interrupt long-running benchmarks while preserving accurate statistics for the partial run.

Implemented a clean signal handling mechanism that:

  1. Detects SIGINT via a signal handler in the main thread
  2. Stops worker threads gracefully by breaking their event loops
  3. Finalizes statistics for all clients before shutdown
  4. Reports elapsed time in the interrupt message
  5. Marks the run as interrupted in JSON output in "Runtime" Section. Similarly the output to stdout also logs the interrupt plus the time.

Testing:
Added a test specifically for this with a large request count and signal after 3 seconds

TEST=tests_oss_simple_flow:test_interrupt_signal_handling OSS_CLUSTER=1 setarch `uname -m` -R ./tests/run_tests.sh

@fcostaoliveira fcostaoliveira merged commit aa9edb8 into master Nov 18, 2025
39 checks passed
@fcostaoliveira fcostaoliveira deleted the signal.export branch November 18, 2025 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants