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);
}

Copy link
Contributor

This PR has had no activity for 9 days. It will be automatically closed in 2 days if there is no activity.

@github-actions github-actions bot added the stale label Jan 27, 2025
@deanlee deanlee force-pushed the params_remove_signal_handle branch from 381482a to f6a8542 Compare January 28, 2025 01:25
@github-actions github-actions bot removed the stale label Jan 28, 2025
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