On Thu, 22 Mar 2007, Steve Hay wrote:

Randy Kobes wrote:
On Wed, 14 Mar 2007, Steve Hay wrote:

I tried your patch with the current svn version (revision 518242), but I'm still seeing intermittent failures (usually in tests 15, 16 and/or 20) either when I run "nmake test" from the top-level,
[ ... ]

Perhaps just to narrow things down, could you try the
attached C file (a VC++ Makefile is also attached)?
[ ... ]
I ran each program with an argument of 500 for good measure. All four programs successfully create and then delete a large number (presumably 500, I didn't count 'em!) of apreq* temp files.

apr_temp and apr_temp_sh both deleted all those files about as quickly as they were made (i.e. very quickly), while apr_temp_nc and apr_temp_nc_sh both output loads of CLEANUP messages in the console quickly but then seemed to hang for nearly a minute, during which time loads of apreq* files were visible in the temp directory, and then eventually exited and all the files disappeared.

On my system (Windows XP, VC++ 6, Apache/2.2.2), there's
essentially no difference in speed between the four
programs in cleaning things up, and like you, all temp
files are gone at the end. I'm afraid I'm stuck ...
Since for you apr_temp/apr_temp_sh (fast) and
apr_temp_nc/apr_temp_nc_sh (hangs a minute) pairwise
behave similarly, that suggests APR_SHARELOCK isn't
relevant (which is supported by it's apparent lack of
relevance to this problem in the Apache sources). APR_FILE_NOCLEANUP does seem to make a (negative)
difference in speed, but perhaps
   http://marc.info/?l=apr-dev&m=117448738223552&w=2
is relevant here. In any case, the above results suggests
that having APR_FILE_NOCLEANUP and APR_SHARELOCK both
undefined would be better, which makes sense, but
both apparently help in the Perl glue on Win32. Sigh ...

I'm wondering the following ... The failed upload
tests (15, 16, and/or 20), for me, involve uploading
the perl.exe binary. Is that the same for you? Might
there be a problem with uploading a file which is
a program that might be in use at the time? Does the
attached patches against
   apreq/library/util.c
which removes the
   flag |= APR_FILE_NOCLEANUP | APR_SHARELOCK
line, and
   apreq/glue/perl/t/apreq/upload.t
which skips using perl.exe (and httpd.exe) for
the upload tests on Win32 work for you?

--
best regards,
Randy
Index: util.c
===================================================================
--- util.c      (revision 522726)
+++ util.c      (working copy)
@@ -823,14 +823,6 @@
 
     /* NO APR_DELONCLOSE! see comment above */
     flag = APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_BINARY;
-    /* Win32 needs the following to remove temp files.
-     * XXX: figure out why the APR_SHARELOCK flag works;
-     * a grep through the httpd sources seems to indicate
-     * it's only used in sdbm files??
-    */
-#ifdef WIN32
-    flag |= APR_FILE_NOCLEANUP | APR_SHARELOCK;
-#endif
     rc = apr_file_mktemp(fp, tmpl, flag, pool);
 
     if (rc == APR_SUCCESS) {
Index: upload.t
===================================================================
--- upload.t    (revision 516765)
+++ upload.t    (working copy)
@@ -4,6 +4,7 @@
 use Apache::Test;
 use Apache::TestUtil;
 use Apache::TestRequest qw(UPLOAD_BODY GET_BODY_ASSERT);
+use constant WIN32 => Apache::TestConfig::WIN32;
 use Cwd;
 require File::Basename;
 
@@ -12,9 +13,12 @@
 my $module = 'TestApReq::upload';
 my $location = Apache::TestRequest::module2url($module);
 
-my %types = (perl => 'application/octet-stream',
-             httpd => 'application/octet-stream',
-            );
+my %types = ();
+unless (WIN32) {
+    %types = (perl => 'application/octet-stream',
+              httpd => 'application/octet-stream',
+             );
+}
 my $vars = Apache::Test::vars;
 my $perlpod = $vars->{perlpod};
 if (-d $perlpod) {

Reply via email to