Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-36668: FIX reuse semaphore tracker for child processes#5172

Merged
pitrou merged 12 commits intopython:masterfrom
tomMoral:PR_fix_semtracker
Apr 24, 2019
Merged

bpo-36668: FIX reuse semaphore tracker for child processes#5172
pitrou merged 12 commits intopython:masterfrom
tomMoral:PR_fix_semtracker

Conversation

@tomMoral
Copy link
Contributor

@tomMoraltomMoral commentedJan 13, 2018
edited
Loading

The current implementation of thesemaphore_tracker creates a new process for each children.
This PR intends to fix this behavior.

The easy fix would be to pass the_pid to the children but the current mechanism to check if thesemaphore_tracker is alive relies onwaitpid which cannot be used in child processes (thesemaphore_tracker is only a sibling of these processes). The main issue is to have a reliable check that either:

  • The pipe is open. This is what is done here by sending a message. I don't know if there is a more efficient way to check it.
  • Check that a given pid is alive. As we cannot rely onwaitpid, I don't see an efficient mechanism.

I took the approach of adding aPROBE command in the semaphore tracker. When the pipe is closed, the send command fails and this means the semaphore tracker is down.

https://bugs.python.org/issue36668

pierreglaser added a commit to pierreglaser/loky that referenced this pull requestMar 20, 2019
pierreglaser added a commit to pierreglaser/loky that referenced this pull requestMar 20, 2019
Co-Authored-By: tomMoral <thomas.moreau.2010@gmail.com>
@tomMoral
Copy link
ContributorAuthor

@pitrou This PR avoid spawningsemaphore_tracker in each subprocesses.

@tomMoraltomMoral changed the titlebpo-31310: FIX reuse semaphore tracker for child processesbpo-36668: FIX reuse semaphore tracker for child processesApr 19, 2019
@tomMoral
Copy link
ContributorAuthor

@pitrou I think this PR is ready

Copy link
Member

@pitroupitrou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks mostly good to me. Just a single comment.

Copy link
Member

@pitroupitrou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

+1 from me

@pitrou
Copy link
Member

@tomMoral Can you force-push to trigger an AppVeyor build?

@tomMoral
Copy link
ContributorAuthor

Done

@pitroupitrou merged commit004b93e intopython:masterApr 24, 2019
@bedevere-bot
Copy link

@pitrou: Please replace# withGH- in the commit message next time. Thanks!

@pitrou
Copy link
Member

Thanks@tomMoral . I don't think this needs to be backported to 3.7, do you concur?

@tomMoral
Copy link
ContributorAuthor

@pitrou yes I agree this is not critical so it is not necessary to backport to 3.7.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@pitroupitroupitrou approved these changes

+2 more reviewers

@ZackerySpytzZackerySpytzZackerySpytz left review comments

@ppperyppperypppery left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@tomMoral@pitrou@bedevere-bot@ZackerySpytz@pppery@the-knights-who-say-ni

[8]ページ先頭

©2009-2026 Movatter.jp