delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/03/12/09:40:35

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,FB_WORD1_END_DOLLAR,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Date: Thu, 12 Mar 2009 15:40:13 +0100
Message-ID: <9e3fd2c80903120740u5fa06d62t372cd67212fad1e@mail.gmail.com>
Subject: Problem getting flock with timeout to work
From: Robert Klemme <shortcutter AT googlemail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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

--002215048d6f48fc750464ecf684
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hi,

I searched the archives but could not find any related issue.  My
problem is this: I use flock with a timeout but apparently the timeout
does not work, i.e. flock waits longer than specified.  Script is
attached.  Output is here:

This is ok, timeout is longer than needed:

15:34:27 tmp$ ./fl-test-2.sh
CYGWIN_NT-5.1 padrklemme1 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin
-rw-r--r-- 1 RKlemme Domain Users 0 Mar 12 15:34 lock
timeout 10
started 1
3672 Thu Mar 12 15:34:32 WEST 2009
started 2
3672 Thu Mar 12 15:34:33 WEST 2009
waiting...
3672 Thu Mar 12 15:34:34 WEST 2009
3672 Thu Mar 12 15:34:35 WEST 2009
3672 Thu Mar 12 15:34:36 WEST 2009
2884 Thu Mar 12 15:34:37 WEST 2009
2884 Thu Mar 12 15:34:39 WEST 2009
2884 Thu Mar 12 15:34:40 WEST 2009
2884 Thu Mar 12 15:34:41 WEST 2009
2884 Thu Mar 12 15:34:42 WEST 2009
done

This looks wrong, timeout is much shorter than what the process takes
and should abort:

15:34:43 tmp$ ./fl-test-2.sh 2
CYGWIN_NT-5.1 padrklemme1 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin
-rw-r--r-- 1 RKlemme Domain Users 0 Mar 12 15:34 lock
timeout 2
started 1
2444 Thu Mar 12 15:34:45 WEST 2009
started 2
2444 Thu Mar 12 15:34:47 WEST 2009
waiting...
2444 Thu Mar 12 15:34:48 WEST 2009
2444 Thu Mar 12 15:34:49 WEST 2009
2444 Thu Mar 12 15:34:50 WEST 2009
4064 Thu Mar 12 15:34:51 WEST 2009
4064 Thu Mar 12 15:34:52 WEST 2009
4064 Thu Mar 12 15:34:53 WEST 2009
4064 Thu Mar 12 15:34:55 WEST 2009
4064 Thu Mar 12 15:34:56 WEST 2009
done
15:34:57 tmp$

Any ideas?  Am I doing something wrong?

Kind regards

robert

--002215048d6f48fc750464ecf684
Content-Type: application/x-sh; name="fl-test-2.sh"
Content-Disposition: attachment; filename="fl-test-2.sh"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_fs7jppsa0

IyEvYmluL3NoCgp1bmFtZSAtYQoKcm0gLWYgbG9jawp0b3VjaCBsb2NrCmxz
IC1sRiBsb2NrCgp0aW1lb3V0PSR7MTotMTB9CmVjaG8gInRpbWVvdXQgJHRp
bWVvdXQiCgpmb3IgaSBpbiAxIDIKZG8KICBmbG9jayAteCAtdyAkdGltZW91
dCAtbyBsb2NrIFwKICAgIC1jICdmb3IgaSBpbiAxIDIgMyA0IDU7IGRvIGVj
aG8gIiQkIGBkYXRlYCI7IHNsZWVwIDE7IGRvbmUnICYKICBlY2hvICJzdGFy
dGVkICRpIgogIHNsZWVwIDEKZG9uZQoKZWNobyAid2FpdGluZy4uLiIKCmZv
ciBpIGluIDEgMgpkbwogIHdhaXQgfHwgZWNobyAiZXhpdCBpcyAkPyIKZG9u
ZQoKZWNobyAiZG9uZSIK


--002215048d6f48fc750464ecf684
Content-Type: text/plain; charset=us-ascii

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

- Raw text -


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