Bug 856 - [ANKK:HSOL-4015] / APV / WebAgent ttl value obtained from DNS server

Review Request #594 — Created Dec. 27, 2024 and submitted

peteryeh
APV10
rel_apv_10_7
856
kevin.poh, tanya, timlai, weikai

getaddrinfo_a() cannot get ttl from dns query, adding c-ares library to retrieve ttl after.
We send another query for ttl for now. May need to replace whole getaddrinfo_a() process with ares_getaddrinfo() in the future.

CLI:
webagent service "WEB_AGENT1" 10.18.206.10 8080 0
webagent dns cache on
show webagent dns host
www.googletagmanager.com:
142.250.198.72 TTL:63
560-nbs-753.mktoresp.com:
199.15.214.243 TTL:270
tags.srv.stackadapt.com:
34.196.12.18 TTL:30
connect.facebook.net:
31.13.87.5 TTL:30
cdn.bizible.com:
152.195.58.59 TTL:3283
geolocation.onetrust.com:
172.64.155.119 TTL:269
nvidia.tt.omtrdc.net:
63.140.50.191 TTL:149
nvidiacorp.us-5.evergage.com:
18.116.125.218 TTL:29
assets.adobedtm.com:
23.208.80.236 TTL:29
cdn.cookielaw.org:
104.18.87.42 TTL:269
images.nvidia.com:
117.18.232.232 TTL:1490
www.nvidia.com:
210.71.227.211 TTL:29
analytics.twitter.com:
104.244.42.195 TTL:633
t.co:
162.159.140.229 TTL:28

Description From Last Updated

please remove white spaces. there are couple of more places in this diff where white spaces are present, please remove …

tanyatanya

If we return here the getaddrinfo_a() query is already sent out so outstanding_dns_req_cnt++; will be incorrect and caller of domain_resolve_asynch() …

tanyatanya

if this is non-blocking call how ttl will be set?

tanyatanya

the same questions about hints argument. it's a local variable since ares_getaddrinfo() is non blocking what will be set to?

tanyatanya
peteryeh
kevin.poh
  1. Ship It!
  2. 
      
timlai
  1. Ship It!
  2. 
      
peteryeh
kevin.poh
  1. Ship It!
  2. 
      
peteryeh
Review request changed

Status: Closed (submitted)

tanya
  1. 
      
  2. please remove white spaces. there are couple of more places in this diff where white spaces are present, please remove them as weel

  3. If we return here the getaddrinfo_a() query is already sent out so outstanding_dns_req_cnt++; will be incorrect and caller of domain_resolve_asynch() will treat it as an error since we return -3 but the getaddrinfo_a() is actually pending so it will come back.

    Since we cannot undo the getaddrinfo_a() call just log the error and continue as in the earlier code, since worse case we just will not have ttl.

    also if ares_init_options() fails do we need any clean up because ares_library_init() was already called.

    If ares_getaddrinfo() works well maybe just use it instead of getaddrinfo_a() and extract ip in the callback. If I understand correctly this should be simple change. But maybe I am missunderstanding something

  4. if this is non-blocking call how ttl will be set?

  5. 
      
tanya
  1. 
      
  2. the same questions about hints argument. it's a local variable since ares_getaddrinfo() is non blocking what will be set to?

  3. 
      
Loading...