nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] folder +./ # Blocks forever where ./ currently mounted


From: nmh
Subject: Re: [Nmh-workers] folder +./ # Blocks forever where ./ currently mounted by autofs (NFS4).
Date: Fri, 05 Aug 2016 19:33:57 -0500

Hi Ken:

On Thu 8/4/16 23:06 -0400 NMH Workers wrote:
> >My goal is to have a set of mh folders for archiving old msgs 
> >on a remote autofs mounted NFS filesystem. When I run the 'folder'
> >command as shown below it hangs (so I have to kill it).
> 
> So, this suggests to me:
> 
> >fcntl(3, F_SETLK, {l_type=F_WRLCK, l_whence=SEEK_SET, l_start=0, l_len=0} 
> ><unfinished ...>
> >+++ killed by SIGKILL +++
> 
> You're getting hung up in locking the sequence file.
> 
> I'm assuming that nothing else is trying to lock that file (you don't
> have any other nmh programs open in another window, do you?).  

No, nothing on the NFS client, ie the one that ran 'folder', and nothing
on the remote Fedora 19 NFS server.

> I don't know the specifics of your NFS filesystem, but does locking
> actually work on it?

Sorry, don't know. I might research a way to test that.

> I seem to recall you need to run things like rpc.statd and
> rpc.lockd to make locking work, at least on NFSv2 and NFSv3.  

I ran 'rpcinfo -p' on the NFS server for you below.

> To me,
> that doesn't seem like an nmh problem, exactly ... I mean, from that
> system call trace we're not trying to lock that file twice, but we
> block hard on the locking call (but other read locks are working earlier
> in that trace).
> 
> And the more I look at it ... the more I am puzzled.  We are using
> F_SETLK, which as I read it should fail immediately if there is a
> conflicting lock.  The fact that it's not failing with an error makes
> me think something more fundamental is going on.

Take a look below.  The same test works OK with *another* mount that uses
a newer host/newer OS: Centos 7.x NFS server vs the older Fedora 19 NFS server.

> If you can't figure out what you need to do to make locks work on your
> NFS filesystem, well, it's easy to change the locking algorithm.  Check
> out the "datalocking" option in mh-profile(5).  The default is fcntl()
> locks, but you should have other options.  "dot" locking should always
> work, but it's the worse-performing.  

Thank you.  For moving messages to the "archive" file system 
with pick and refile, I do not need speed - I think it will be a cron job.

> You could try lockf or flock locking,
> if nmh detected that support was available (they'll be listed in the
> mh-profile(5) man page if they are).

--
Thanks again Ken.
Tom

--
# Test using same fedora 23 NFS client but w/a centos 7.2 NFS4 server

This shell is on the same host as before.  I automount ~/Mail to
a remote NFS filesystem, but that remote host is physically in same
datacenter.  All 3 hosts have similar firewall setups, that I think
(I'm not an expert) these are good/secure for NFS.

    ~/Mail/inbox $ grep 'tsr_Mail ' /etc/auto.a
    tsr_Mail      -rw,hard,intr anotherdomain.org:/home/rodmant/Mail
    ~/Mail/inbox $ df .
    Filesystem              Size  Used Avail Use% Mounted on
    anotherdomain.org:/home/rodmant   30G  5.6G   23G  20% /a/rodmant
    ~/Mail/inbox $ strace folder +./
    execve("/usr/local/nmh/bin/folder", ["folder", "+./"], [/* 40 vars */]) = 0
    brk(NULL)                               = 0x75e000
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f6b59eed000
    access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or 
directory)
    open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
    fstat(3, {st_mode=S_IFREG|0644, st_size=31987, ...}) = 0
    mmap(NULL, 31987, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6b59ee5000
    close(3)                                = 0
    open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
    read(3, 
"\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\6\2\0\0\0\0\0"..., 832) = 
832
    fstat(3, {st_mode=S_IFREG|0755, st_size=2104216, ...}) = 0
    mmap(NULL, 3934688, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f6b5990d000
    mprotect(0x7f6b59ac4000, 2097152, PROT_NONE) = 0
    mmap(0x7f6b59cc4000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b7000) = 0x7f6b59cc4000
    mmap(0x7f6b59cca000, 14816, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6b59cca000
    close(3)                                = 0
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f6b59ee4000
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f6b59ee3000
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f6b59ee2000
    arch_prctl(ARCH_SET_FS, 0x7f6b59ee3700) = 0
    mprotect(0x7f6b59cc4000, 16384, PROT_READ) = 0
    mprotect(0x610000, 4096, PROT_READ)     = 0
    mprotect(0x7f6b59eee000, 4096, PROT_READ) = 0
    munmap(0x7f6b59ee5000, 31987)           = 0
    brk(NULL)                               = 0x75e000
    brk(0x77f000)                           = 0x77f000
    brk(NULL)                               = 0x77f000
    open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
    fstat(3, {st_mode=S_IFREG|0644, st_size=111950656, ...}) = 0
    mmap(NULL, 111950656, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6b52e49000
    close(3)                                = 0
    rt_sigaction(SIGHUP, {0x4092f0, [], SA_RESTORER|SA_RESTART, 
0x7f6b59941ab0}, {SIG_DFL, [], 0}, 8) = 0
    rt_sigaction(SIGINT, {0x4092f0, [], SA_RESTORER|SA_RESTART, 
0x7f6b59941ab0}, {SIG_DFL, [], 0}, 8) = 0
    rt_sigaction(SIGQUIT, {0x4092f0, [], SA_RESTORER|SA_RESTART, 
0x7f6b59941ab0}, {SIG_DFL, [], 0}, 8) = 0
    rt_sigaction(SIGTERM, {0x4092f0, [], SA_RESTORER|SA_RESTART, 
0x7f6b59941ab0}, {SIG_DFL, [], 0}, 8) = 0
    rt_sigaction(SIGILL, {0x4092f0, [], SA_RESTORER|SA_RESTART, 
0x7f6b59941ab0}, {SIG_DFL, [], 0}, 8) = 0
    rt_sigaction(SIGBUS, {0x4092f0, [], SA_RESTORER|SA_RESTART, 
0x7f6b59941ab0}, {SIG_DFL, [], 0}, 8) = 0
    rt_sigaction(SIGSEGV, {0x4092f0, [], SA_RESTORER|SA_RESTART, 
0x7f6b59941ab0}, {SIG_DFL, [], 0}, 8) = 0
    open("/a/rodmant/.mh_profile", O_RDONLY) = 3
    lseek(3, 0, SEEK_CUR)                   = 0
    fstat(3, {st_mode=S_IFREG|0664, st_size=11, ...}) = 0
    mmap(NULL, 524288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 
= 0x7f6b59e62000
    read(3, "Path: Mail\n", 524288)         = 11
    read(3, "", 524288)                     = 0
    read(3, "", 524288)                     = 0
    lseek(3, 0, SEEK_CUR)                   = 11
    read(3, "", 524288)                     = 0
    close(3)                                = 0
    munmap(0x7f6b59e62000, 524288)          = 0
    stat("/a/rodmant/Mail", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
    open("/a/rodmant/Mail/context", O_RDONLY) = 3
    fcntl(3, F_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=0, l_len=0}) 
= 0
    fcntl(3, F_GETFL)                       = 0x8000 (flags 
O_RDONLY|O_LARGEFILE)
    lseek(3, 0, SEEK_CUR)                   = 0
    fstat(3, {st_mode=S_IFREG|0664, st_size=38, ...}) = 0
    mmap(NULL, 524288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 
= 0x7f6b59e62000
    read(3, "Current-Folder: /a/rodmant/Mail/"..., 524288) = 38
    read(3, "", 524288)                     = 0
    read(3, "", 524288)                     = 0
    lseek(3, 0, SEEK_CUR)                   = 38
    read(3, "", 524288)                     = 0
    close(3)                                = 0
    munmap(0x7f6b59e62000, 524288)          = 0
    getcwd("/a/rodmant/Mail/inbox", 4096)   = 22
    chdir("/a/rodmant/Mail/")               = 0
    stat("/a/rodmant/Mail/inbox", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
    stat("/a/rodmant/Mail/inbox", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
    open("/a/rodmant/Mail/inbox", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
    fstat(3, {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
    access("/a/rodmant/Mail/inbox", W_OK)   = 0
    getdents(3, /* 5 entries */, 32768)     = 152
    getdents(3, /* 0 entries */, 32768)     = 0
    close(3)                                = 0
    open("/a/rodmant/Mail/inbox/.mh_sequences", O_RDWR) = 3
    fcntl(3, F_SETLK, {l_type=F_WRLCK, l_whence=SEEK_SET, l_start=0, l_len=0}) 
= 0
    fcntl(3, F_GETFL)                       = 0x8002 (flags O_RDWR|O_LARGEFILE)
    lseek(3, 0, SEEK_CUR)                   = 0
    fstat(3, {st_mode=S_IFREG|0600, st_size=7, ...}) = 0
    mmap(NULL, 524288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 
= 0x7f6b59e62000
    read(3, "cur: 1\n", 524288)             = 7
    read(3, "", 524288)                     = 0
    read(3, "", 524288)                     = 0
    lseek(3, 0, SEEK_CUR)                   = 7
    read(3, "", 524288)                     = 0
    close(3)                                = 0
    munmap(0x7f6b59e62000, 524288)          = 0
    fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 3), ...}) = 0
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f6b59eec000
    write(1, "/a/rodmant/Mail/inbox+ has 1 mes"..., 63/a/rodmant/Mail/inbox+ 
has 1 message   (1-1); cur=1; (others).
    ) = 63
    exit_group(0)                           = ?
    +++ exited with 0 +++
    ~/Mail/inbox $

# anotherdomain.org is the centos 7 NFS server
 
# Fedora 19 NFS server that is associated w/lock issue:

    address@hidden:/var/home/rodmant $ rpcinfo -p
       program vers proto   port  service
        100000    4   tcp    111  portmapper
        100000    3   tcp    111  portmapper
        100000    2   tcp    111  portmapper
        100000    4   udp    111  portmapper
        100000    3   udp    111  portmapper
        100000    2   udp    111  portmapper
        100024    1   udp  33851  status
        100024    1   tcp  34531  status
        100003    3   tcp   2049  nfs
        100003    4   tcp   2049  nfs
        100227    3   tcp   2049  nfs_acl
        100003    3   udp   2049  nfs
        100003    4   udp   2049  nfs
        100227    3   udp   2049  nfs_acl
        100021    1   udp  45923  nlockmgr
        100021    3   udp  45923  nlockmgr
        100021    4   udp  45923  nlockmgr
        100021    1   tcp  43311  nlockmgr
        100021    3   tcp  43311  nlockmgr
        100021    4   tcp  43311  nlockmgr
        100011    1   udp    875  rquotad
        100011    2   udp    875  rquotad
        100011    1   tcp    875  rquotad
        100011    2   tcp    875  rquotad
        100005    1   udp    892  mountd
        100005    1   tcp    892  mountd
        100005    2   udp    892  mountd
        100005    2   tcp    892  mountd
        100005    3   udp    892  mountd
        100005    3   tcp    892  mountd





reply via email to

[Prev in Thread] Current Thread [Next in Thread]