Browse Source

Set server status error on network failure

Tatsuhiro Tsujikawa 9 years ago
parent
commit
a1ce6d2e7f
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/AbstractCommand.cc

+ 5 - 0
src/AbstractCommand.cc

@@ -304,6 +304,11 @@ bool AbstractCommand::execute()
     }
 
     if (errorEventEnabled()) {
+      // older kernel may report "connection refused" here.
+      auto ss = e_->getRequestGroupMan()->getOrCreateServerStat(
+          req_->getHost(), req_->getProtocol());
+      ss->setError();
+
       throw DL_RETRY_EX(
           fmt(MSG_NETWORK_PROBLEM, socket_->getSocketError().c_str()));
     }