Skip to content

Commit

Permalink
Merge pull request #83 from mariux64/clusterd-lsof-bw
Browse files Browse the repository at this point in the history
clusterd: fix timeouts
  • Loading branch information
donald authored Apr 12, 2019
2 parents 9a9993c + 01fb092 commit e190fbd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion clusterd/clusterd
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,10 @@ sub clp_rx_LSOF {
defined $pid or die "$!\n";
unless ($pid) {
$socket->blocking(1);
open P,'timeout -k 32s 30s lsof -n|' or die "$!\n";
# -n inhibits the conversion of network numbers to host names for network files.
# -b causes lsof to avoid kernel functions that might block - lstat(2), readlink(2), and stat(2).
# -w disables warning messages.
open P,'timeout -k 92s 90s lsof -n -b -w|' or die "$!\n";
while (<P>) {
next if defined $pattern && index($_,$pattern)<0;
$socket->send(pack('n',length($_)).$_,0);
Expand Down

0 comments on commit e190fbd

Please sign in to comment.