Forking update daemon does not detect child exiting

Development-related discussion, including bundled plugins
landure
Bear Rating Trainee
Bear Rating Trainee
Posts: 25
Joined: 15 Jan 2008, 12:09

Forking update daemon does not detect child exiting

Postby landure » 24 Jan 2008, 14:10

When the child process exit very quickly (less than 1 or 2 seconds), the parent process is not able to detect its death.

So the running_process counter is wrong.

In the end, there is no more forking because the parent process think that there are already forks presents.

A fix to this is to use a array of process pids instead of a fork counter.

running_process_count = array_count($running_process)

And to check that the pids in $running_process array still exist on system.

What do you think of this fix ?

Pierre-Yves
http://howto.landure.fr/

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Forking update daemon does not detect child exiting

Postby fox » 24 Jan 2008, 14:25

Good idea, should be more reliable.

Ed: Created a separate forum for development-related discussion.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Postby fox » 24 Jan 2008, 14:43

It's in the trunk. Seems to work okay.


Return to “Development”

Who is online

Users browsing this forum: No registered users and 2 guests