Boost C++ Libraries: Ticket #12073: Why read callback not call https://svn.boost.org/trac10/ticket/12073 <p> I write a simple test server but meet a strange problem. </p> <p> In my test server, I start a 10 threads pool to run io_service.run function. </p> <p> I created a boost::asio::ip::tcp::acceptor object and call 'listen' function, final call 'async_accept' to start a asynchronous operation. Then if a client connect to server, the accept callback function will be called. In accept callback function, I do three thing: 1, create a boost::asio::strand object 2, create a boost::asio::deadline_timer object to set timeout, if the client does not send any data for 5 seconds, the timer callback will be called. In this timer callback, the server will send a hearbeat request to client and expect to receive a hearbeat response from the client. 3, call async_read_some to set read callback function. </p> <p> Of cause 'async_wait' in step 2 and 'async_read_some' call in step 3 are both wrapper in strand object which is created in step 1. </p> <p> To test this server, I write a demo python client. This demo client just connect to server and send hearbeat request to server, then expect to receive a hearbeat response. I set a crontab task to call this demo python client every one minute. The most tests are OK, but the test would random fail. </p> <p> Everytime it failed, I have checked the output of tcpdump on server, the server successfully receives the hearbeat request, but the read callback function is not called. </p> <p> So why the read callback function is not called just when the hearbeat request is received. It looks like the read event is missing, is it about edge trigger in epoll? </p> <p> This random failure could reproduce on both CentOS 6.5 and CentOS 6.6, the boost version is boost 1.48.0, the compiler is gcc 4.4.7. </p> <p> Does anyone meet this bug? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12073 Trac 1.4.3 anonymous Wed, 14 Jun 2017 08:21:49 GMT <link>https://svn.boost.org/trac10/ticket/12073#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12073#comment:1</guid> <description> <p> update boost to 1.54.0 and have a try. </p> </description> <category>Ticket</category> </item> </channel> </rss>