inet_gethost_native.

Geoff Wong geoff@REDACTED
Tue Apr 18 05:46:16 CEST 2000


Hi,

inet_gethost_native.erl (kernel lib)  has an interesting dependency 
upon being able to resolve names. If it fails a number of times
the kernel supervisor gets shutdown and the entire node goes down.
Since we're supposed to be building robust system this
isn't really good behaviour (the failure occurs sometime
after a cable is pulled on the box with the node in question).

My question is: is this the intended behaviour?

We've have a small patch that gives "better" behaviour
(in our opinion). Basically it shuts down the process
and its restart normally next time a resolution request is made
(so you can poll name resolution if you're waiting for a paritioned
network to come up again).

Can people see any problems with this patch (system affecting ones)?
And any reasons why this behaviour is "worse" than the current
behaviour?

Any feedback appreciated :)

Geoff

------ cut here


--- inet_gethost_native.erl	Tue Apr 18 11:58:34 2000
+++ inet_gethost_native.erl.orig	Tue Apr 18 11:58:33 2000
@@ -137,7 +137,7 @@
 		    {stop, Reason, {error, Reason}, State}
 		after Timeout ->
 			catch erlang:port_close(Port),
-			{stop, normal, {error, timeout}, State}
+			{stop, shutdown, {error, timeout}, State}
 	    end
     end.
 
@@ -212,7 +212,7 @@
 ensure_started() ->
     case whereis(inet_gethost_native) of
 	undefined -> 
-	    C = {inet_gethost_native, {?MODULE, start_link, []}, temporary, 1000, 
+	    C = {inet_gethost_native, {?MODULE, start_link, []}, permanent, 1000, 
 		 worker, [?MODULE]},
 	    case whereis(kernel_safe_sup) of
 		undefined ->




More information about the erlang-questions mailing list