I am currently running this on Redhat Linux version 7.3 and using Perl version 5.8.0. I've tried different things - let the process run and process multiple batches of files and I have killed it with kill -9 command on the pid and then restarted the program. First run is always good - it sends out the information correctly. Second run it prints to the screen that it is in the send portion of the program and is looping correctly but in fact, no data is sent out and the data is not deleted from the mysql database. I'll take a look at the link and try removing the SIG{CHLD} to see if that is of any help.
Jessee ----- Original Message ----- From: "david" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, November 07, 2002 5:02 PM Subject: Re: Strange behaviour > Jessee Parker wrote: > > > Hi all, > > > > I have a script that basically waits for 2 files to be delivered to > > it, > > then it processes the 2 files, inserts them into the database and then > > starts sending information. After information is sent, it deletes the > > record from the database and increments a counter. I do a fork in the > > subroutine that does the sending / deleting portion. What I've come to > > notice is that if I do this once, it sends everything fine and the data is > > correctly erased from the database. The next time I do this, it runs, > > doesn't complain about any errors but it doesn't do the send and it > > doesn't perform the delete. Here is the sending portion of the co > > Are you running this in UNIX? whar version of Perl you have? > There is a well-known bug when using fork in Perl under UNIX. check this > out: > > http://archive.develooper.com/perl5-porters@;perl.org/msg87476.html > > the bug had been reported to the Perl bug list. if you know how to use truss > in UNIX, run your script through truss but don't trace fork and child > execution, you will see a bunch of setContext() calls that Perl calls when > you fork, if you do a man setContext(), you will know why this can be a > problem. what happen is that Perl resets all process-wide static variable > in the parent process so the behavior is very odd in the parent... > > someone suggest to remove the $SIG{CHLD} hanlder (if you have one) and see > if it solve the problem or not. i haven't try this myself. > > this appears to be only affect UNIX machine(ie, BSD or Linux seems to be > ok.) But i have seen very similar situation in RH8 as well... > > since i didn't read through your whole script, your problem might be totally > different but it's something you should keep an open eye on... > > david > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]