Skip to content

fork: moving fork handling from behind the experiment#255

Merged
eugeneo merged 1 commit intofork/11-can-tests-passfrom
fork/16-python-test-no-experiment
May 20, 2025
Merged

fork: moving fork handling from behind the experiment#255
eugeneo merged 1 commit intofork/11-can-tests-passfrom
fork/16-python-test-no-experiment

Conversation

@eugeneo
Copy link
Copy Markdown
Owner

@eugeneo eugeneo commented May 20, 2025

  • Moves fork handling from behind the event_engine_fork experiment
    • No experiment (parity with original fork implementation):
      • Thread pool and timer manager will go through the fork as expected
      • Epoll poller fd will be recreated in the child
      • EventHandles are closed in the child process.
    • Behind experiment (new functionality):
      • File descriptors are tracked in the collection
      • FD generation is tracked and checked on every Posix call.
      • AresResolver is reset on fork
  • Fixes to address race between PosixEngine destructor and fork
    handling.
    • Thread pool will properly handle fork even if the parent PosixEngine
      instance entered the destructor before the fork call
    • Thread pool fork handler will wait for the parent event engine
      destructor to finish before shutting down threads.

- Moves fork handling from behind the event_engine_fork experiment
  - No experiment (parity with original fork implementation):
    - Thread pool and timer manager will go through the fork as expected
    - Epoll poller fd will be recreated in the child
    - EventHandles are closed in the child process.
  - Behind experiment (new functionality):
    - File descriptors are tracked in the collection
    - FD generation is tracked and checked on every Posix call.
    - AresResolver is reset on fork
- Fixes to address race between PosixEngine destructor and fork
  handling.
  - Thread pool will properly handle fork even if the parent PosixEngine
    instance entered the destructor before the fork call
  - Thread pool fork handler will wait for the parent event engine
    destructor to finish before shutting down threads.
@eugeneo eugeneo merged commit fa84674 into fork/11-can-tests-pass May 20, 2025
0 of 2 checks passed
@eugeneo eugeneo deleted the fork/16-python-test-no-experiment branch May 20, 2025 17:12
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