From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126109 invoked by alias); 29 May 2017 19:50:05 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 126097 invoked by uid 89); 29 May 2017 19:50:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_THEBAT,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 spammy=H*F:D*yandex.ru, H*M:yandex, settled, HX-Priority:Normal X-HELO: forward2m.cmail.yandex.net Received: from forward2m.cmail.yandex.net (HELO forward2m.cmail.yandex.net) (5.255.216.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 May 2017 19:50:03 +0000 Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::25]) by forward2m.cmail.yandex.net (Yandex) with ESMTP id E4DFB20ECE; Mon, 29 May 2017 22:50:03 +0300 (MSK) Received: from smtp1o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1o.mail.yandex.net (Yandex) with ESMTP id 408C51300576; Mon, 29 May 2017 22:50:02 +0300 (MSK) Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id PRpNlqE5XO-o2gicp37; Mon, 29 May 2017 22:50:02 +0300 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client certificate not present) Authentication-Results: smtp1o.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0 Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Mon, 29 May 2017 19:46:30 -0000 Date: Mon, 29 May 2017 20:05:00 -0000 From: Andrey Repin Reply-To: cygwin@cygwin.com Message-ID: <214223429.20170529224630@yandex.ru> To: L A Walsh , cygwin@cygwin.com Subject: Re: 5 seconds to update link info? (cause found) In-Reply-To: <592BE84A.6040400@tlinx.org> References: <9810467454.20170520003732@yandex.ru> <592BE84A.6040400@tlinx.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg00484.txt.bz2 Greetings, L A Walsh! > Andrey Repin wrote: >> When executed this oneliner over Samba 4.3 network share, it takes 5 seconds >> to match the newly created hardlink. >> I'm wondering if this is Cygwin, Samba or Windows networking issue? >> > ==== > BTW -- found the cause of this: > Under: > HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters > There are 3 values to control cache lifetime. > FileInfoCacheLifetime (default 10 seconds) > FileNotFoundCacheLifetime (default 5 seconds) > DirectoryCacheLifetime (default 10 seconds) > The FileNotFoundCacheLifetime looks to be the culprit -- since > when I traced the ethernet traffic with wireshark, I would see > multiple responses of 'notfound' before it finally showed up. > I reset my 5-second value to 3, and your script passed over > its value in 3 seconds after that... > You might have to reboot your machine to ensure the value gets > propegated to the LANmanworkstation client. > There are other ways, but none that reliable. Thank you for this discovery. In the end, I've settled on a little wrapper. waitlink() { ( set -e ln "$1" "$2" for i in . . . . . . . . . .; do [ "$1" -ef "$2" ] && break sleep 1 done ) } since the execution time of the script is not mission-critical, I decided to not alter the system settings. -- With best regards, Andrey Repin Monday, May 29, 2017 22:23:30 Sorry for my terrible english... -- 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