> -----Original Message----- > From: Olaf Hering <olaf@xxxxxxxxx> > Sent: Monday, November 5, 2018 6:07 AM > To: KY Srinivasan <kys@xxxxxxxxxxxxx>; Michael Kelley > <mikelley@xxxxxxxxxxxxx> > Cc: devel@xxxxxxxxxxxxxxxxxxxxxx > Subject: caching of FQDN in kvp_daemon > > In commit 58125210ab ("Tools: hv: cache FQDN in kvp_daemon to avoid > timeouts") I changed the code to lookup the hostname just once during > start. While this works most of the time, there is still a slim chance that name > resolution does not work properly at that time. As a result the host will > always get an error string instead of the current hostname, like "getaddrinfo > failed: 0xfffffffe Name or service not known". > > I wonder how much effort kvp_daemon should do to provide the hostname. > Does the host make any use of that string, other than eventually show it to > an admin? In my case it was shown that way in the "Windows Admin Center > dashboard". > > Possible solutions are: > - link kvp_daemon to pthread and run a separate thread to resolve the > hostname just once, or periodically. > - spawn a separate resolver process, do not wait for it and process the result > if anything is provided by that helper. > - just leave the code as is and deal with incorrect data. Not sure if the host > would actually notice a change in the hostname string. I am not sure who uses the information on the host and how. That said, I think one other solution we can evaluate is the following: We will resolve until we get a resolution. That is, we would keep state indicating that the resolution failed (if it failed) and we would attempt to resolve during the next query. Once we have successfully resolved, we would use the cached value. K. Y > > Olaf _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel