Project

General

Profile

Feature #8505

netstat should warn when name services are slow

Added by Robert Mustacchi about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Category:
cmd - userland programs
Start date:
2017-07-18
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

As we've seen in cases like 6211 and 8503, when name services are not working, understanding what's going on in the system can be very confusing. In the case of netstat, it may appear to the end user that system is hung, when it's actually the opposite – that we got data from the kernel, but couldn't resolve it. In this case, what we'd like to do is warn once so the user has a hope of understanding what's going on. If this isn't functioning because something else is going on, then we wouldn't end up having any warnings.

History

#1

Updated by Robert Mustacchi about 2 years ago

  • Subject changed from traceroute should warn when name services are slow to netstat should warn when name services are slow
#2

Updated by Robert Mustacchi about 2 years ago

To test this, I used netstat normally and then made it so all DNS traffic was blackholed. After which I ran commands and had the following:

[root@haswell ~]# netstat -r

Routing Table: IPv4
  Destination           Gateway           Flags  Ref     Use     Interface 
-------------------- -------------------- ----- ----- ---------- --------- 
warning: data available, but name service lookups are taking a while. Use the -n option to disable name service lookups.
default              172.20.0.1           UG        4        710 igb0      
localhost            localhost            UH        2          0 lo0       
172.20.0.0           haswell              U         4        132 igb0      

Routing Table: IPv6
  Destination/Mask            Gateway                   Flags Ref   Use    If   
--------------------------- --------------------------- ----- --- ------- ----- 
localhost                   localhost                   UH      2       0 lo0   
[root@haswell ~]# arp -a
Net to Media Table: IPv4
Device   IP Address               Mask      Flags      Phys Addr
------ -------------------- --------------- -------- ---------------
warning: data available, but name service lookups are taking a while. Use the -n option to disable name service lookups.
igb0   224.0.0.251          255.255.255.255 S        01:00:5e:00:00:fb
igb0   172.20.0.51          255.255.255.255          00:25:90:76:c2:7f
igb0   haswell              255.255.255.255 SPLA     00:25:90:d3:11:d2
igb0   172.20.0.1           255.255.255.255          02:08:20:76:79:df
igb0   224.0.0.22           255.255.255.255 S        01:00:5e:00:00:16

I also went back and ran things both with the -n flag while name services were disabled and with name services functioning correctly.

#3

Updated by Electric Monk about 2 years ago

  • Status changed from New to Closed

git commit afee3dc66d7b1fb4aaedced0814360f4334bc2c0

commit  afee3dc66d7b1fb4aaedced0814360f4334bc2c0
Author: Robert Mustacchi <rm@joyent.com>
Date:   2017-08-08T19:21:49.000Z

    8503 snoop seems to delay packets doing DNS resolution
    8504 traceroute should warn when name services are slow
    8505 netstat should warn when name services are slow
    8506 ping name service warnings should only happen once
    Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
    Reviewed by: Dan McDonald <danmcd@joyent.com>
    Reviewed by: Yuri Pankov <yuripv@gmx.com>
    Approved by: Gordon Ross <gwr@nexenta.com>

Also available in: Atom PDF