diff --git a/dbms/src/Common/TaskStatsInfoGetter.cpp b/dbms/src/Common/TaskStatsInfoGetter.cpp index 8f4d1c6c4ee..a9e5f6f636a 100644 --- a/dbms/src/Common/TaskStatsInfoGetter.cpp +++ b/dbms/src/Common/TaskStatsInfoGetter.cpp @@ -139,7 +139,13 @@ void TaskStatsInfoGetter::init() if (netlink_socket_fd >= 0) return; + struct timeval tv; + tv.tv_sec = 5; + tv.tv_usec = 0; + netlink_socket_fd = ::socket(PF_NETLINK, SOCK_RAW, NETLINK_GENERIC); + ::setsockopt(netlink_socket_fd, SOL_SOCKET, SO_RCVTIMEO, reinterpret_cast(&tv), sizeof(tv)); + if (netlink_socket_fd < 0) throwFromErrno("Can't create PF_NETLINK socket");