Project

General

Profile

Bug #8172

Patch to make ping_hosts.sh faster and avoid carp deadlock

Added by Harry Coin almost 3 years ago. Updated almost 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Gateway Monitoring
Target version:
Start date:
12/07/2017
Due date:
% Done:

100%

Estimated time:
Affected Version:
All
Affected Architecture:
All

Description

In /usr/local/bin/ping_hosts.sh we have
..
  1. Read in ipsec ping hosts and check the CARP status
    if [ -f /var/db/ipsecpinghosts ]; then
    IPSECHOSTS="/var/db/ipsecpinghosts"
    CURRENTIPSECHOSTS="/var/db/currentipsecpinghosts"
    IFVPNSTATE=`ifconfig $IFVPN | grep "carp: BACKUP vhid" | wc -l`

Please change that to

  1. Read in ipsec ping hosts and check the CARP status
    if [ -f /var/db/ipsecpinghosts && -s /var/db/ipsecpinghosts ]; then
    ...
    Because /var/db/ipsecpinghosts seems to get written by the gui at 0 bytes whether we use ipsec or not.
    Which causes the pinger to run ifconfig, which waits on a lock, which I think participates in a deadlock situation.
    And, even if it doesn't, there's no point in running a bunch of ifconfig commands when the file exists and is size 0.

Associated revisions

Revision 45d078c5 (diff)
Added by Jim Pingle almost 3 years ago

Skip IPsec ping host CARP check when there are no IPSec ping hosts. Also, add a safety belt so cat can't get stuck waiting on input. Fixes #8172

Revision c5dde24a (diff)
Added by Jim Pingle almost 3 years ago

Skip IPsec ping host CARP check when there are no IPSec ping hosts. Also, add a safety belt so cat can't get stuck waiting on input. Fixes #8172

(cherry picked from commit 45d078c5964b94dd2aa7f1a609fcb47e89eaac49)

Revision f2e610bc (diff)
Added by Jim Pingle almost 3 years ago

Skip IPsec ping host CARP check when there are no IPSec ping hosts. Also, add a safety belt so cat can't get stuck waiting on input. Fixes #8172

(cherry picked from commit 45d078c5964b94dd2aa7f1a609fcb47e89eaac49)

Revision f6e83ca2 (diff)
Added by Jim Pingle almost 3 years ago

Skip IPsec ping host CARP check when there are no IPSec ping hosts. Also, add a safety belt so cat can't get stuck waiting on input. Fixes #8172

(cherry picked from commit 45d078c5964b94dd2aa7f1a609fcb47e89eaac49)

History

#1 Updated by Jim Pingle almost 3 years ago

  • Assignee set to Jim Pingle
  • Target version set to 2.4.2-p1
  • Affected Version set to All
  • Affected Architecture All added
  • Affected Architecture deleted ()

It wasn't quite as simple as changing that one line, but I made a change that should have the same net effect.

#2 Updated by Jim Pingle almost 3 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

#3 Updated by Jim Pingle almost 3 years ago

  • Status changed from Feedback to Resolved

Also available in: Atom PDF