zsh-workers
 help / color / mirror / code / Atom feed
* Re: Bug#482525: failure to fcntl-lock history file, takes ages to create interactive session
       [not found] <20080523094636.GA3814@piper.oerlikon.madduck.net>
@ 2008-05-23 13:24 ` Clint Adams
  2008-05-23 22:30   ` Vincent Lefevre
  0 siblings, 1 reply; 4+ messages in thread
From: Clint Adams @ 2008-05-23 13:24 UTC (permalink / raw)
  To: martin f krafft, 482525; +Cc: zsh-workers

On Fri, May 23, 2008 at 11:46:36AM +0200, martin f krafft wrote:
> When I log in to a machine where my ~ is NFS-mounted (lockd is in
> use), with hist_fcntl_lock set, it takes several minutes to get an
> interactive prompt. The reason is that the locking seems to fail,
> according to strace:
> 
>   open("/home/madduck/.var/zsh/history-diamond", O_RDWR|O_NOCTTY) = 3
>   fcntl64(3, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = -1 EIO (Input/output error)
>   rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
>   rt_sigaction(SIGCHLD, NULL, {0x80a88a0, [], SA_INTERRUPT}, 8) = 0
>   rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
>   nanosleep({1, 0}, {1, 0})         = 0 
> 
> This repeats a number of times before it finally moves on. Complete
> strace is attached. Search for "EIO".

Out of curiosity, does the same thing happen if you use -o nolock on the
client?


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

* Re: Bug#482525: failure to fcntl-lock history file, takes ages to create interactive session
  2008-05-23 13:24 ` Bug#482525: failure to fcntl-lock history file, takes ages to create interactive session Clint Adams
@ 2008-05-23 22:30   ` Vincent Lefevre
  2008-05-24  2:56     ` Clint Adams
  0 siblings, 1 reply; 4+ messages in thread
From: Vincent Lefevre @ 2008-05-23 22:30 UTC (permalink / raw)
  To: martin f krafft, 482525, zsh-workers

[-- Attachment #1: Type: text/plain, Size: 992 bytes --]

On 2008-05-23 13:24:08 +0000, Clint Adams wrote:
> On Fri, May 23, 2008 at 11:46:36AM +0200, martin f krafft wrote:
> > This repeats a number of times before it finally moves on. Complete
> > strace is attached. Search for "EIO".
> 
> Out of curiosity, does the same thing happen if you use -o nolock on
> the client?

Don't you mean -o nohistfcntllock?

I've attached a small program to test whether fcntl lock is working.

Usage: tfcntl <file> <sleeptime>

It will lock the file <file> for <sleeptime> seconds. You can execute
it with <sleeptime> = 1. If you don't get the prompt after 1 second,
then there's a problem. I've already seen such problems in the past
(the NFS server needed to be rebooted), which affected other software
using fcntl lock, e.g. mail software.

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)

[-- Attachment #2: tfcntl.c --]
[-- Type: text/plain, Size: 880 bytes --]

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>

int main (int argc, char *argv[])
{
  FILE *f;
  int fd;
  struct flock lck;

  if (argc != 3)
  {
    fprintf (stderr, "Usage: tfcntl <file> <sleeptime>\n");
    exit (1);
  }

  f = fopen (argv[1], "r+b");
  if (f == NULL)
  {
    fprintf (stderr, "tfcntl: can't open file %s\n", argv[1]);
    perror ("tfnctl");
    exit (2);
  }
  fd = fileno (f);

  memset (&lck, 0, sizeof (struct flock));
  lck.l_type = F_WRLCK;
  lck.l_whence = SEEK_SET;
  if (fcntl (fd, F_SETLK, &lck) == -1)
  {
    fprintf (stderr, "tfcntl: lock failed (errno = %d)\n", errno);
    perror ("tfnctl");
    exit (3);
  }

  sleep(atoi(argv[2]));

  memset (&lck, 0, sizeof (struct flock));
  lck.l_type = F_UNLCK;
  lck.l_whence = SEEK_SET;
  fcntl (fd, F_SETLK, &lck);

  return 0;
}

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

* Re: Bug#482525: failure to fcntl-lock history file, takes ages to create interactive session
  2008-05-23 22:30   ` Vincent Lefevre
@ 2008-05-24  2:56     ` Clint Adams
  2008-05-27  8:32       ` martin f krafft
  0 siblings, 1 reply; 4+ messages in thread
From: Clint Adams @ 2008-05-24  2:56 UTC (permalink / raw)
  To: martin f krafft, 482525, zsh-workers

On Sat, May 24, 2008 at 12:30:34AM +0200, Vincent Lefevre wrote:
> Don't you mean -o nohistfcntllock?

No, I meant mount -o nolock on the client to see if the behavior was
consistent with a lock-disabled NFS mount.


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

* Re: Bug#482525: failure to fcntl-lock history file, takes ages to create interactive session
  2008-05-24  2:56     ` Clint Adams
@ 2008-05-27  8:32       ` martin f krafft
  0 siblings, 0 replies; 4+ messages in thread
From: martin f krafft @ 2008-05-27  8:32 UTC (permalink / raw)
  To: 482525, zsh-workers

[-- Attachment #1: Type: text/plain, Size: 500 bytes --]

also sprach Clint Adams <clint@zsh.org> [2008.05.24.0456 +0200]:
> No, I meant mount -o nolock on the client to see if the behavior was
> consistent with a lock-disabled NFS mount.

The problem appears to be the same with -o nolock.

-- 
 .''`.   martin f. krafft <madduck@debian.org>
: :'  :  proud Debian developer, author, administrator, and user
`. `'`   http://people.debian.org/~madduck - http://debiansystem.info
  `-  Debian - when you have better things to do than fixing systems

[-- Attachment #2: Digital signature (see http://martin-krafft.net/gpg/) --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2008-05-27 15:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20080523094636.GA3814@piper.oerlikon.madduck.net>
2008-05-23 13:24 ` Bug#482525: failure to fcntl-lock history file, takes ages to create interactive session Clint Adams
2008-05-23 22:30   ` Vincent Lefevre
2008-05-24  2:56     ` Clint Adams
2008-05-27  8:32       ` martin f krafft

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).