浏览代码

Set server status error on network failure

Tatsuhiro Tsujikawa 9 年之前
父节点
当前提交
a1ce6d2e7f
共有 1 个文件被更改,包括 5 次插入0 次删除
  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()));
     }