Bug 962755
| Summary: | lsof command hangs on a system with unavailable NFS share. | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Lukas Pramuk <lpramuk> |
| Component: | lsof | Assignee: | Peter Schiffer <pschiffe> |
| Status: | CLOSED NOTABUG | QA Contact: | BaseOS QE - Apps <qe-baseos-apps> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.4 | CC: | jpazdziora, tlestach |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-10-15 14:29:18 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Lukas Pramuk
2013-05-14 11:45:45 UTC
I'd add that this bug report is a spin-off from bug 961463 and that our use of lsof in the Satellite code base is lsof -t -i TCP:8005 -p 31789 And the strange thing is that the above command blocks while merely doing lsof -t -i TCP:8005 | grep '^31789$' does not block. It's a bit counterintuitive that a less specific lsof command would run fine while the more specific (which should be able to touch less /proc files or whatever lsof is using) blocks. This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate, in the next release of Red Hat Enterprise Linux. Hi guys, really sorry for such a late response, but here it is: Jan: those two commands are not equivalent. By default, lsof is doing an OR on options. Equivalent lsof version of grep command would be: $ lsof -t -a -i TCP:8005 -p 31789 (but that would also block because lsof is scanning mount points for the -p option) Anyway, blocking issue is well known for lsof and it tries to handle it with multiple ways. There are 3 sections in lsof(8) man page discussing this issue (BLOCKS AND TIMEOUTS, AVOIDING KERNEL BLOCKS and ALTERNATE DEVICE NUMBERS). Long story short, the blocking is done on the kernel side, in one of the lstat(2), readlink(2) and stat(2) syscalls. lsof tries to avoid block by using timers and child processes, where you can control the length of the timer via -S option (default 15 seconds), however, this does not work for me. Another possibility is to use -b option, which tells to lsof to avoid mentioned syscalls and which for me, works great. (In reply to Peter Schiffer from comment #5) > > Long story short, the blocking is done on the kernel side, in one of the > lstat(2), readlink(2) and stat(2) syscalls. lsof tries to avoid block by > using timers and child processes, where you can control the length of the > timer via -S option (default 15 seconds), however, this does not work for > me. Another possibility is to use -b option, which tells to lsof to avoid > mentioned syscalls and which for me, works great. Thank you for the explanation. |