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

WIP app_python3: need a test for a real child process #3139

Closed
wants to merge 1 commit into from

Conversation

aalba6675
Copy link
Contributor

@aalba6675 aalba6675 commented Jun 9, 2022

app_python3 needs to call PyOS_AfterFork_Child()/PyOS_AfterFork()
in real child processes.

We need a test for this: rank > 0 may not be sufficient due to
non-forking mode. This POC uses getpid().

  • Commit message has the format required by CONTRIBUTING guide
  • Commits are split per component (core, individual modules, libs, utils, ...)
  • Each component has a single commit (if not, squash them into one commit)
  • No commits to README files for modules (changes must be done to docbook files
    in doc/ subfolder, the README file is autogenerated)

Type Of Change

  • Small bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would change existing functionality)

Checklist:

  • PR should be backported to stable branches
  • Tested changes locally
  • Related to issue #XXXX (replace XXXX with an open issue number)

Description

@miconda @henningw : this PR is for discussion only: in KEMI Python there is an interpreter function that needs to be called after fork() in real child processes. I realise that rank > 0 may not be a completely correct test as kamailio has a non-forking mode(this is the test used in master and 5.6 to fix GH#3125). Your comments would be appreciated.

This POC uses getpid() to detect a “real” child process.

Is there a flag somewhere that a module can tell that it is running in a child process?

app_python3 needs to call PyOS_AfterFork_Child()/PyOS_AfterFork()
in real child processes.

We need a test for this: rank > 0 may not be sufficient due to
non-forking mode. This POC uses getpid().
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.

None yet

1 participant