delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/02/06/12:48:34

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <27481771.post@talk.nabble.com>
Date: Sat, 6 Feb 2010 09:48:21 -0800 (PST)
From: Chap Harrison <clh AT pobox DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Slow manipulation of network-shared files
In-Reply-To: <6910a61002052120m64fa1e6erafbcaef7543e9f62@mail.gmail.com>
MIME-Version: 1.0
References: <27474697 DOT post AT talk DOT nabble DOT com> <6910a61002052120m64fa1e6erafbcaef7543e9f62 AT mail DOT gmail DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com


Reini Urban wrote:
> 
> 5s looks more like a race. But I have no idea what could cause the race.
> Could be that Java is still holding the handle until the gc frees it.
> 
Interesting thought.  I just tried a one-second delay before my first
attempt to move the file after having seen the log message indicating the
file had been closed.  This was to lessen the likelihood that I would be in
a race with file closing.  It made no appreciable difference: for most
files, I succeed in moving them on the first try; for maybe 10% I succeed in
moving them after between 2 and 5 tries (at one-second intervals); for maybe
10% of them I fail at moving them but then fall back and successfully copy
them instead; and for 3% of them, even the copy fails.

(Using 'copy' makes me nervous - if the problem is that the file is not
completely & totally "closed", what if the final buffers of output haven't
yet been flushed?)

Your idea about Java holding the handle until gc runs sounds very plausible.

Lastly, although I'm not sure I've eliminated all other variables, it
appears that the problem is considerably worse in Cygwin 1.7 than in Cygwin
1.5.  In 1.5, I succeed in moving the file on the first try about 95% of the
time.

Well, (he said, trying to be philosophical about it), in a way this whole
effort is about racing with the Java app to scoop some output files away to
safety before it circles around and clobbers them, so it's not surprising
that it's less than 100% reliable.

I'd welcome any ideas on improving my odds, however!  :-)
-- 
View this message in context: http://old.nabble.com/Slow-manipulation-of-network-shared-files-tp27474697p27481771.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019