Bug 218231 - NFSd shutdown is very slow due to script bug
Summary: NFSd shutdown is very slow due to script bug
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: nfs-utils
Version: 4.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Steve Dickson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 222001
TreeView+ depends on / blocked
 
Reported: 2006-12-03 22:53 UTC by Tamas Kerecsen
Modified: 2007-11-17 01:14 UTC (History)
0 users

Fixed In Version: RHBA-2007-0316
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-05-01 23:27:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0316 0 normal SHIPPED_LIVE nfs-utils bug fix update 2007-04-30 14:44:30 UTC

Description Tamas Kerecsen 2006-12-03 22:53:32 UTC
Description of problem:
The /etc/init.d/nfs script tries to shut down nfsd using "killproc nfsd".
Killproc first sends a TERM signal to all nfsd instances, then waits for 4
seconds and finally sends a KILL signal. Since nfsd ignores the TERM signal, the
script will always have to wait 4 seconds, slowing down the shutdown by 4
seconds each time.

(I'm not sure about the rationale behind ignoring TERM, but based on some
comments in the equivalent code in freeBSD, it seems that the designers wanted
to make sure nfsd is the last daemon to get killed so the loopback mounts can be
unmounted properly.) 

As the comments in the kernel's fs/nfsd/nfssvc.c explain, the virtual nfsd
kernel processes should be killed by sending a KILL, HUP, INT or QUIT signal to
them (with HUP being the fastest as it will forgo cleaning the exports table).

An even more future-proof and robust solution is calling "rpc.nfsd -- 0", which
sets the number of nfsd processes to 0 thus killing all current instances.
(Internally it is equivalent to sending a HUP to all processes, but much faster
and more robust because it's only a single kernel call.)

Version-Release number of selected component (if applicable):
N/A

How reproducible:

Steps to Reproduce:
1. Execute "/etc/init.d/nfs stop"
2.
3.
  
Actual results:
It takes just over 4 seconds for the script to complete

Expected results:
It should take less than 1 second for the script to complete

Additional info:
N/A

Comment 1 RHEL Program Management 2006-12-08 13:33:14 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 3 Steve Dickson 2007-01-09 15:29:51 UTC
Fixed in nfs-utils-1.0.6-76

Comment 7 Red Hat Bugzilla 2007-05-01 23:27:57 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0316.html



Note You need to log in before you can comment on or make changes to this bug.