implement optional watchdog for remote connections
[scpubgit/Object-Remote.git] / lib / Object / Remote / Role / Connector.pm
index d5d46d7..dac9939 100644 (file)
@@ -7,8 +7,6 @@ use Moo::Role;
 
 requires '_open2_for';
 
-#TODO return to 10 seconds after debugging
-#has timeout => (is => 'ro', default => sub { { after => 10 } });
 has timeout => (is => 'ro', default => sub { { after => 10 } });
 
 sub connect {
@@ -38,6 +36,7 @@ sub connect {
       undef($channel);
     });
     $channel->on_close_call(sub {
+      log_trace { "Connection has been closed" };
       $f->fail("Channel closed without seeing Shere: $_[0]");
       undef($channel);
     });
@@ -46,9 +45,6 @@ sub connect {
                   ->watch_time(
                       %{$self->timeout},
                       code => sub {
-#                        log_warn { "Connection timed out for child pid '$child_pid'" };
-#                        $f->fail("Connection timed out") unless $f->is_ready;
-#                        undef($channel);
                         Dlog_trace { "Connection timeout timer has fired for child pid '$child_pid'; is_ready: $_" } $f->is_ready;
                         unless($f->is_ready) {
                             log_warn { "Connection with child pid '$child_pid' has timed out" };