Operating System - HP-UX
1754143 Members
3649 Online
108811 Solutions
New Discussion юеВ

HpUX - Python - fork & exec in Threads hang - intermittently

 
Ajay Bakhshi
New Member

HpUX - Python - fork & exec in Threads hang - intermittently

Hi,

I am facing the following problem on HP & python.

Background:

I have a GUI (QT package) and I am running tasks in Threads. These threads spawn a process and read the output of the process and then display the O/P on the GUI.

Now I can get a new process spawned by using a menu option.

Now every alternate time the process hangs (spawned from the same gui):

I.e. First process hangs.
Second goes through fine.
Third goes fine
Fourth hangs.



More on the problem:

This is what happens, when I call

os.fork()

In the parent process I get the Pid of the child and the parent is fine.
But in the child process (even before calling exec) my print statements work but anything os.XXX function call fails. I did a very simple stuff: before calling exec:

Os.system("touch /tmp/m1") and this system call fails (for situations where the process hangs).



NOTE: The hp system is:

HP-UX 11.11
It has MSCS cluster installed on it.

Python: 2.2.3

Has any body seen such a hanging of processes.

Thanks
-Ajay B
2 REPLIES 2
Steven E. Protter
Exalted Contributor

Re: HpUX - Python - fork & exec in Threads hang - intermittently

Could be a lot of things:

Corrupt process table.
Too many processes.
SG getting hung up. You said SG is installed, is the box part of a cluster? Are their monitor scriptts?

Some performance data collection might help. See attachement

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ajay Bakhshi
New Member

Re: HpUX - Python - fork & exec in Threads hang - intermittently

Hi Steven,

The problem had gone after we rebooted the machine. (But thats not exceptable in a customer environment).

The system load at that point was very light.
I do not expect any kind of resource problem.

Also using this in python programatically I do not too much say in memory management and hence memory corruption is also a remote possibility. Also the same program never gave any problem on Non-cluster hosts. Though this obsevation may be misleading.

The box is a part of two node cluster (MC / ServiceGuard)

The ran the script you provide. It is tared.
Thanks