From: <ta...@us...> - 2010-01-21 14:41:31
|
Revision: 4330 http://gfarm.svn.sourceforge.net/gfarm/?rev=4330&view=rev Author: tatebe Date: 2010-01-21 14:40:34 +0000 (Thu, 21 Jan 2010) Log Message: ----------- user's server also reconnects to gfmd in case connection error happens Modified Paths: -------------- gfarm_v2/trunk/server/gfsd/gfsd.c Modified: gfarm_v2/trunk/server/gfsd/gfsd.c =================================================================== --- gfarm_v2/trunk/server/gfsd/gfsd.c 2010-01-21 14:36:16 UTC (rev 4329) +++ gfarm_v2/trunk/server/gfsd/gfsd.c 2010-01-21 14:40:34 UTC (rev 4330) @@ -3076,6 +3076,14 @@ "died: %s\n", canonical_self_name, gfarm_error_string(e)); } +static void +gfm_client_reconnect(void) +{ + gfm_client_connection_free(gfm_server); + gfm_server = NULL; + gfm_client_connect_with_reconnection(); +} + void server(int client_fd, char *client_name, struct sockaddr *client_addr) { @@ -3202,6 +3210,9 @@ cleanup(0); exit(1); } + if (gfm_client_is_connection_error( + gfp_xdr_flush(gfm_client_connection_conn(gfm_server)))) + gfm_client_reconnect(); } } @@ -3281,14 +3292,6 @@ } static void -reconnect_back_channel(void) -{ - gfm_client_connection_free(gfm_server); - gfm_server = NULL; - gfm_client_connect_with_reconnection(); -} - -static void back_channel_server(void) { gfarm_error_t e; @@ -3309,14 +3312,14 @@ if (IS_CONNECTION_ERROR(e) || eof) { gflog_error(GFARM_MSG_1000564, "back channel disconnected"); - reconnect_back_channel(); + gfm_client_reconnect(); goto retry; } else if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000565, "(back channel) request error, reset: %s", gfarm_error_string(e)); - reconnect_back_channel(); + gfm_client_reconnect(); goto retry; } switch (request) { @@ -3330,7 +3333,7 @@ gflog_error(GFARM_MSG_1000566, "(back channel) unknown request %d, " "reset", (int)request); - reconnect_back_channel(); + gfm_client_reconnect(); goto retry; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |