Let us say for the sake of example that this is the sequence during success:

1. create/open file
2. write to file
3. close file
4. reopen file
5. provide file handle
6. close file
7. unlink file

Lets imagine that something went wrong with the apache server and it dropped 
the post/form data that otherwise would have been put in its temp file.  The 
system sequence would look like this:

1. create/open file
3. close file
7. unlink file

Hm, that sounds like your symptom.

A close friend and business partner of mine was complaining about a problem he 
encountered in his apache server unexpectedly after years of problem free 
operation.

His cgi scripts were randomly - and for certain clients consistently - not 
receiving their form posts.  His error logs were spammed, his customers were 
quite annoyed.

We spent some time speculating about what could cause such behavior, but in the 
end he went for the generally sane step of making sure he had the latest apache 
server software running on his servers.

The problem disappeared.

It occurs to me that the symptom you are troubleshooting is remarkably similar 
to the same problem.  Perhaps there is a bug that has been fixed, and you need 
to update apache to a newer release?

It is worth a try, and it does match the case study - though we have no idea 
why the server would suddenly have developed this form data delivery problem.  
Perhaps its one of those strange artifacts in complex systems that we work 
around and don't worry about overly much.

David



-----Original Message-----
From: mjurgens [mailto:mjurg...@edcint.co.nz] 
Sent: Tuesday, March 30, 2010 2:41 PM
To: modperl@perl.apache.org
Subject: RE: Intermittent File Upload Failures - CGI tmpfile unlinked


You'll need to be more precise than this because I can't quite follow your
logic given that in a "good" process the strace shows the file being written
to, but in a "bad" process it shows it being unlinked instead of being
written to (and it is never written to, and the perl also can not find the
file after being given the file name).


Ihnen, David wrote:
> 
> I don't believe that the problem you are having is that the file is
> unlinked from the filesystem.  That would not stop it from being writable. 
> The problem may be that the file is inappropriately closed later before
> its fseek'd back to the beginning to operate on the temp contents, thus
> causing it to really disappear.
> 
> David
> 

-- 
View this message in context: 
http://old.nabble.com/Intermittent-File-Upload-Failures---CGI-tmpfile-unlinked-tp28078476p28088874.html
Sent from the mod_perl - General mailing list archive at Nabble.com.

Reply via email to