Open htfy96 opened 7 years ago
https://travis-ci.org/htfy96/c10k-server/jobs/195526832 Build was broken.
Didn't appear in the latest build. Possible causes:
server_t
had already terminated(Fixed in https://github.com/htfy96/c10k-server/commit/d0a931efce8ef1b222128addee25b3a656ae9b1f)Fixed by https://github.com/htfy96/c10k-server/commit/09753751a5d439bd82898ed9837e49bc12f7e698.
According to man 3 socket
:
The socket() function may fail if: ENOBUFS Insufficient resources were available in the system to perform the operation.
In our test_common.hpp
(https://github.com/htfy96/c10k-server/commit/09753751a5d439bd82898ed9837e49bc12f7e698#diff-98636da8eed2704a07464a7657f2b580L41), we created an unused socket. Since TEST_CNT=600
before the above commit, and each test consists of 1 client socket, 1 server socket and 1 unused socket, 600 * 3 > 1024 = max_fn, while socket
still returns a invalid socket fd in this case, which propagates into other functions(even triggered exception in Connection::close
)
Solution: Remove unused socket and reduce TEST_CNT=500
UseMonitor event on single fd, since we need to handle close (High)dup
to monitorPOLLIN
andPOLLOUT
individually on two different epoll eventsMemory pool?(Low)[No time for this 😠]