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

params: move blocking read to Cython and remove C++ signal handling #34407

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

deanlee
Copy link
Contributor

@deanlee deanlee commented Jan 17, 2025

re-open #32367

The current C++ blocking read have signal handling issues:

  1. Its custom signal handler prevents other modules from receiving SIGINT/SIGTERM signals during blocking read, leading to improper termination.
  2. When multiple blocking reads occur concurrently in different threads, the later-read thread might restore the signal handler to the params_sig_handler installed by the preceding blocking read. This action permanently disables the default signal handler or the handler set up by the program, leading to improper signal handling within the program after blocking reads.

this PR replaces the problematic C++ blocking reads with Cython implementation. This new implementation delegates the handling of SIGINT and SIGTERM signals to Python's built-in mechanisms, ensuring smoother interruption management.

This PR removes C++ support for blocking reads (as they are no longer needed in the current C++ codebase), though they remain straightforward to implement if required:

while (!exit) {
  val = params.read(key);
  if (!val.empty()) break;

  util::sleep_for(100);
}

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