Find the answer to your Linux question:
Results 1 to 7 of 7
Server A: pop3 server storage nfs server exports /var/spool/mail Server B: pop3 client server nfs client fstab entry: x.x.x.x:/var/spool/mail /var/spool/mail nfs bg,nfsvers=3,intr,retrans=1,udp problem: If Server A's nfsd go down for ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2003
    Posts
    3

    NFS Client hang squashes all disk I/O


    Server A:
    pop3 server storage
    nfs server
    exports /var/spool/mail
    Server B:
    pop3 client server
    nfs client
    fstab entry: x.x.x.x:/var/spool/mail /var/spool/mail nfs bg,nfsvers=3,intr,retrans=1,udp

    problem:
    If Server A's nfsd go down for any reason Server B will become unresponsive to any i/o even if its i/o not ment for the nfs mount point. Putting some debug print statements in the pop3 software shows that 'it' experiences a lockup when fopen(mailbox) is called accross the nfs mount. Which is understandable but what we are not sure of is why it occurs if I want to do a `ls /home/`. I have tried useing an alarm in the pop3 software like so:
    <cut>
    alarm(NFSTIMEOUT);
    if(!(fmbox=fp=fopen(mailbox=auth_mailboxname((auth _identity*)pass),"r+b)))
    {
    alarm(0);
    /* do stuff here */
    }
    alarm(0);
    /* continue reading mail */

    <cut>

    What I do know is the alarm does succeed but does nothing untill the nfs mount comes back up which is run the routine for when an alarm is called.

  2. #2
    Linux Engineer
    Join Date
    Jan 2003
    Location
    Lebanon, pa
    Posts
    994
    Are you mounting with "hard" or "soft"?

  3. #3
    Just Joined!
    Join Date
    Feb 2003
    Posts
    3
    Quote Originally Posted by genlee
    Are you mounting with "hard" or "soft"?
    Hard mount. Soft will not be acceptable.

  4. #4
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Quote Originally Posted by IcarusLR
    but what we are not sure of is why it occurs if I want to do a `ls /home/`.
    Have you considered the possibility that it might be because bash checks for new mail?

  5. #5
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Quote Originally Posted by IcarusLR
    What I do know is the alarm does succeed but does nothing untill the nfs mount comes back up which is run the routine for when an alarm is called.
    I'm not sure if I were able to parse this English correctly. Did I get you correctly? The SIGALRM is delivered adter NFSTIMEOUT seconds, but it didn't interrupt the fopen, and the fopen doesn't continue until the NFS server comes back online?
    In that case, you must be sure to install a signal handler for SIGALRM. If you just SIG_IGNore it, nothing out of the ordinary will happen, just as you are experiencing. If, however, you install a signal handler for it, fopen will return with errno == EINTR.

  6. #6
    Just Joined!
    Join Date
    Feb 2003
    Posts
    3
    cucipop defines the signals here.

    static void bailout(void);

    void blocksignals(void)
    {
    signal(SIGUP,SIG_IGN);
    signal(SIGINT,SIG_IGN);
    signal(SIGTERM,SIG_IGN);
    signal(SIGPIPE,SIG_IGN);
    signal(SIGALRM,SIG_IGN);
    #ifdef SIGURG
    signal(SIGURG,SIG_IGN);
    #endif
    }

    void setsignals(void)
    {
    Signal(SIGHUP,bailout);
    Signal(SIGINT,bailout);
    Signal(SIGTERM,bailout);
    Signal(SIGPIPE,bailout);
    Signal(SIGALRM,bailout);
    #ifdef SIGURG
    Signal(SIGURG,bailout);
    #endif
    }

    static void bailout(void)
    { const static char abnormal[]="-ERR abnormal shutdown\r\n";
    blocksignals();write(1,abnormal,STRLEN(abnormal)); terminate(EX_NOINPUT); */
    }

    now alarm() does work elsewhere, this I am sure of. But when inserting debug prints inside bailout() they do not print untill the nfs server comes back up. What I understand from this is that the program cannot return until the fopen succeeds, but it doesnt succeed, once the server comes back up it goes ahead and executes the alarm since this alarm timer ran out during the fopen. Its like linux is blocking any i/o which is the case if I even want to right a file to another drive set. It waits until the nfs mount which has nothing to do with where I am writing comes back up.

  7. #7
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    I have noticed that NFS behaves strangely from time to time. Check "ps -lp `pidof cucipop`" when it happens (check the S and WCHAN fields more specifically).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •