Skip to main content

Problem:

  • Product Name: VisiBroker
  • Product Version: All
  • Product Component: ORB Smart Agent
  • Platform/OS Version: HP-UX


When the Domain Name Service (DNS) is unresponsive, the osagent startup can be delayed for several minutes. It depends on the DNS resolver setting.

Osagent will open a port to handle interaction with clients known as the client handler (refer to vbroker.agent.clientHandlerPort property of the VisiBroker Developer's Guide). To get the local host, osagent calls system API gethostbyname_r(), which will query the DNS and invoke the hosts resolution policy defined in /etc/nsswitch.conf file. If the first DNS is unresponsive, the call to gethostbyname_r() will block until a time out (as configured by the OS) has expired while the policy has been enforced. See `man nsswitch.conf` for details on status (i.e. NOTFOUND) and action (CONTINUE). A sample entry of /etc/nsswitch.conf will be as follows:

$ cat /etc/nsswitch.conf
 passwd: files
 group: files
 hosts: dns [ NOTFOUND = CONTINUE ] nis [ NOTFOUND = CONTINUE ] files
 networks: files
 protocols: files
 :

Hosts resolution policy sets that for any gethostbyname*() system function call, the DNS will first be queried, then the NIS, and finally the file-based lookup (/etc/hosts). DNS will query the name servers defined /etc/resolv.conf. When the DNS entry is non-responsive, the query on that server will be delayed until the retries and time out has expired. Since the default action for UNAVAIL is CONTINUE, it then queries the NIS. This will add further delay if NIS is also unresponsive. Finally, when it continues to the file-based lookup (/etc/hosts), the osagent will be able to pick up the hostname and IP address of the local host, assuming the /etc/hosts has the host name and IP address resolution, for example:

127.0.0.1 localhost loopback
143.186.139.143 foo-server

The following is an example of a delay in osagent startup when the DNS is unresponsive:

 1 $ osagent -a 143.186.139.216 -v
 2 ==>> Thu Apr 2 23:16:32 2009, dsachdlr.C, 0, Inf
 3 create_instances() Bound to the following interfaces:
 4
 5 ==>> Thu Apr 2 23:19:12 2009, dsachdlr.C, 0, Inf
 6 DSAClientHandler() Binding to .
 7
 8 ==>> Thu Apr 2 23:19:12 2009, dsathdlr.C, 0, Inf
 9 create_instances() Bound to the following interfaces:
 10
 11 ==>> Thu Apr 2 23:19:12 2009, dsathdlr.C, 0, Inf
 12 DSATCPClientHandler() Listening on .
 13
 14 ==>> Thu Apr 2 23:19:12 2009, dsahdlr.C, 0, Inf
 15 create_instances() Bound to the following interfaces:
 16
 17 ==>> Thu Apr 2 23:19:12 2009, dsahdlr.C, 0, Inf
 18 VisiBroker 7.0 DSAgentHandler() Bound to agent UDP port: 14000

Note the 2 minutes and 40 seconds gap on lines #2 and #5.

When the DNS is responsive, here is a sample output:

 1 $ osagent -a 143.186.139.216 -v
 2 ==>> Thu Apr 2 23:37:20 2009, dsachdlr.C, 0, Inf
 3 create_instances() Bound to the following interfaces:
 4
 5 ==>> Thu Apr 2 23:37:20 2009, dsachdlr.C, 0, Inf
 6 DSAClientHandler() Binding to .
 7
 8 ==>> Thu Apr 2 23:37:20 2009, dsathdlr.C, 0, Inf
 9 create_instances() Bound to the following interfaces:
 10
 11 ==>> Thu Apr 2 23:37:20 2009, dsathdlr.C, 0, Inf
 12 DSATCPClientHandler() Listening on .
 13
 14 ==>> Thu Apr 2 23:37:20 2009, dsahdlr.C, 0, Inf
 15 create_instances() Bound to the following interfaces:
 16
 17 ==>> Thu Apr 2 23:37:20 2009, dsahdlr.C, 0, Inf
 18 VisiBroker 7.0 DSAgentHandler() Bound to agent UDP port: 14000

Resolution:

 
If you cannot administering the DNS servers immediately, you can set the file-based lookup as the first entry in the hosts policy in /etc/nsswitch.conf and ensure that the host name and IP address resolution is correctly set in /etc/hosts. If the lookup through DNS is necessary, then the DNS unresponsiveness will have to be resolved by the network administrator.

Note, the parameter `osagent -a ` will still not solve the problem as in the sample output above.
 


#Security
#VisiBroker