--- loncom/loncron 2011/06/03 20:45:10 1.90 +++ loncom/loncron 2011/10/28 14:26:15 1.91 @@ -2,7 +2,7 @@ # Housekeeping program, started by cron, loncontrol and loncron.pl # -# $Id: loncron,v 1.90 2011/06/03 20:45:10 raeburn Exp $ +# $Id: loncron,v 1.91 2011/10/28 14:26:15 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -652,8 +652,18 @@ sub check_delayed_msg { # pong to all servers that have delayed messages # this will trigger a reverse connection, which should flush the buffers foreach my $tryserver (keys %servers) { - my $answer=&Apache::lonnet::reply("pong",$tryserver); - &log($fh,"Pong to $tryserver: $answer
"); + my $answer; + eval { + local $SIG{ ALRM } = sub { die "TIMEOUT" }; + alarm(20); + $answer = &Apache::lonnet::reply("pong",$tryserver); + alarm(0); + }; + if ($@ && $@ =~ m/TIMEOUT/) { + print "time out while contacting: $tryserver for pong\n"; + } else { + &log($fh,"Pong to $tryserver: $answer
"); + } } }