Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

CPU usage 100% ( Request hangs ) #496

Closed
Assignees
deanberris
Milestone
@spritab

Description

@spritab

The http client application hangs in infinite loop in io_service::run, if server accept connection and do nothing. There are no reaction on closing socket at server side.
You can reproduce this using following steps:

  • run server using command at separate terminal:
whiletrue;doecho""| nc -l 8091;done
  • compile and run the program:
// main.cpp#include<iostream>#include<boost/network/include/http/client.hpp>intmain (int argc,char *argv[] ){typedef boost::network::http::basic_client<      boost::network::http::tags::http_async_8bit_tcp_resolve,1,1>       Client;  Client client;  Client::requestreq("http://localhost:8091");  Client::response resp = client.get(req);  std::cout <<body(resp) << std::endl;return0;}

This program will work forever ( ever you terminate netcat ), and you can observe 100% CPU usage by this program at top utility.
system: Ubuntu 14.04 LTS 64bit
boost version: 1.54
cpp-netlib version: 0.11-devel (cpp-netlib-0.11.1-final also consists this isssue)

$ cat /usr/include/boost/version.hpp| fgrep"#define BOOST_LIB_VERSION"#define BOOST_LIB_VERSION "1_54"$ git rev-parse HEAD6e090b3d0b3c4f3b132432a6763594593cf7f365$ git branch* 0.11-devel$ g++ --versiong++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2

Jetty shows such server behaivior, when there are lack of memory.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp