public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* 5 seconds to update link info?
@ 2017-05-19 22:01 Andrey Repin
  2017-05-19 22:10 ` Richard H Lee
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Andrey Repin @ 2017-05-19 22:01 UTC (permalink / raw)
  To: All

Greetings, All!

_a=fileA;
_b=fileB;
[ ! -f "$_a" ] && touch "$_a";
[ ! -f "$_b" ] && ln "$_a" "$_b";
for i in $(seq 1 10);
do sleep 1;
[ "$_a" -ef "$_b" ] && { echo Timed in $i; break;}; done;
rm "$_a" "$_b"

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?


-- 
With best regards,
Andrey Repin
Saturday, May 20, 2017 00:31:35

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 5 seconds to update link info?
  2017-05-19 22:01 5 seconds to update link info? Andrey Repin
@ 2017-05-19 22:10 ` Richard H Lee
  2017-05-20  0:50   ` Richard H Lee
  2017-05-20 20:00 ` L A Walsh
  2017-05-29  9:58 ` 5 seconds to update link info? (cause found) L A Walsh
  2 siblings, 1 reply; 8+ messages in thread
From: Richard H Lee @ 2017-05-19 22:10 UTC (permalink / raw)
  To: cygwin

On 19/05/2017 22:37, 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?

I think it's something to do with windows name resolution.

Try running:
ls //

You should see a similar delay.

--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 5 seconds to update link info?
  2017-05-19 22:10 ` Richard H Lee
@ 2017-05-20  0:50   ` Richard H Lee
  2017-05-20  4:17     ` Andrey Repin
  0 siblings, 1 reply; 8+ messages in thread
From: Richard H Lee @ 2017-05-20  0:50 UTC (permalink / raw)
  To: cygwin

On 19/05/2017 23:01, Richard H Lee wrote:
> On 19/05/2017 22:37, 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?
> 
> I think it's something to do with windows name resolution.
> 
> Try running:
> ls //
> 
> You should see a similar delay.

I forgot to mention that you can get rid of this delay by disabling
NetBIOS on your active network connection(s). I don't think this should
interfere with the operation of Samba.

--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 5 seconds to update link info?
  2017-05-20  0:50   ` Richard H Lee
@ 2017-05-20  4:17     ` Andrey Repin
  2017-05-20 20:04       ` Richard H Lee
  0 siblings, 1 reply; 8+ messages in thread
From: Andrey Repin @ 2017-05-20  4:17 UTC (permalink / raw)
  To: Richard H Lee, cygwin

Greetings, Richard H Lee!

> On 19/05/2017 23:01, Richard H Lee wrote:
>> On 19/05/2017 22:37, 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?
>> 
>> I think it's something to do with windows name resolution.
>> 
>> Try running:
>> ls //
>> 
>> You should see a similar delay.

> I forgot to mention that you can get rid of this delay by disabling
> NetBIOS on your active network connection(s). I don't think this should
> interfere with the operation of Samba.

I've tried to disable NetBIOS over TCP/IP on client for all adapters active,
but nothing has changed.


-- 
With best regards,
Andrey Repin
Saturday, May 20, 2017 03:35:13

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 5 seconds to update link info?
  2017-05-19 22:01 5 seconds to update link info? Andrey Repin
  2017-05-19 22:10 ` Richard H Lee
@ 2017-05-20 20:00 ` L A Walsh
  2017-05-29  9:58 ` 5 seconds to update link info? (cause found) L A Walsh
  2 siblings, 0 replies; 8+ messages in thread
From: L A Walsh @ 2017-05-20 20:00 UTC (permalink / raw)
  To: cygwin

Andrey Repin wrote:
> Greetings, All!
>
> _a=fileA;
> _b=fileB;
> [ ! -f "$_a" ] && touch "$_a";
> [ ! -f "$_b" ] && ln "$_a" "$_b";
> for i in $(seq 1 10);
> do sleep 1;
> [ "$_a" -ef "$_b" ] && { echo Timed in $i; break;}; done;
> rm "$_a" "$_b"
>
> When executed this oneliner over Samba 4.3 network share,
----
    What oneliner?



--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 5 seconds to update link info?
  2017-05-20  4:17     ` Andrey Repin
@ 2017-05-20 20:04       ` Richard H Lee
  0 siblings, 0 replies; 8+ messages in thread
From: Richard H Lee @ 2017-05-20 20:04 UTC (permalink / raw)
  To: cygwin

On 20/05/2017 01:39, Andrey Repin wrote:
> I've tried to disable NetBIOS over TCP/IP on client for all adapters
> active, but nothing has changed.

You could always try using Wireshark to get more insight as to what is
causing the delay.

--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 5 seconds to update link info? (cause found)
  2017-05-19 22:01 5 seconds to update link info? Andrey Repin
  2017-05-19 22:10 ` Richard H Lee
  2017-05-20 20:00 ` L A Walsh
@ 2017-05-29  9:58 ` L A Walsh
  2017-05-29 20:05   ` Andrey Repin
  2 siblings, 1 reply; 8+ messages in thread
From: L A Walsh @ 2017-05-29  9:58 UTC (permalink / raw)
  To: cygwin

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.






--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 5 seconds to update link info? (cause found)
  2017-05-29  9:58 ` 5 seconds to update link info? (cause found) L A Walsh
@ 2017-05-29 20:05   ` Andrey Repin
  0 siblings, 0 replies; 8+ messages in thread
From: Andrey Repin @ 2017-05-29 20:05 UTC (permalink / raw)
  To: L A Walsh, cygwin

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-05-29 19:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-19 22:01 5 seconds to update link info? Andrey Repin
2017-05-19 22:10 ` Richard H Lee
2017-05-20  0:50   ` Richard H Lee
2017-05-20  4:17     ` Andrey Repin
2017-05-20 20:04       ` Richard H Lee
2017-05-20 20:00 ` L A Walsh
2017-05-29  9:58 ` 5 seconds to update link info? (cause found) L A Walsh
2017-05-29 20:05   ` Andrey Repin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).