{"action":"created","issue":{"url":"https://api.github.com/repos/tatsuhiro-t/nghttp2/issues/515","repository_url":"https://api.github.com/repos/tatsuhiro-t/nghttp2","labels_url":"https://api.github.com/repos/tatsuhiro-t/nghttp2/issues/515/labels{/name}","comments_url":"https://api.github.com/repos/tatsuhiro-t/nghttp2/issues/515/comments","events_url":"https://api.github.com/repos/tatsuhiro-t/nghttp2/issues/515/events","html_url":"https://github.com/tatsuhiro-t/nghttp2/issues/515","id":133937162,"number":515,"title":"res.on_close calback doesn't arrive at all, if the client cancels the request ","user":{"login":"rameshrajagopal","id":4286270,"avatar_url":"https://avatars.githubusercontent.com/u/4286270?v=3","gravatar_id":"","url":"https://api.github.com/users/rameshrajagopal","html_url":"https://github.com/rameshrajagopal","followers_url":"https://api.github.com/users/rameshrajagopal/followers","following_url":"https://api.github.com/users/rameshrajagopal/following{/other_user}","gists_url":"https://api.github.com/users/rameshrajagopal/gists{/gist_id}","starred_url":"https://api.github.com/users/rameshrajagopal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rameshrajagopal/subscriptions","organizations_url":"https://api.github.com/users/rameshrajagopal/orgs","repos_url":"https://api.github.com/users/rameshrajagopal/repos","events_url":"https://api.github.com/users/rameshrajagopal/events{/privacy}","received_events_url":"https://api.github.com/users/rameshrajagopal/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tatsuhiro-t/nghttp2/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-02-16T10:10:21Z","updated_at":"2016-03-02T14:41:05Z","closed_at":null,"body":"My application spawns 50 threads and concurrently make a connection with nghttp2 server. Server receives the request and after processing it posts the response back to the io_service. \r\n```cpp\r\n//Client code \r\n std::shared_ptr<Host> clientHost;\r\n    Status ret = client.createSession(host_name, port, conn_timeout,\r\n            read_timeout, clientHost);\r\n    EXPECT_EQ(ret, Status::SUCCESS);\r\n    if (ret != Status::SUCCESS) {\r\n        LOG(ERROR) << \"operation=connect failed to connect\" << std::endl;\r\n        return;\r\n    }\r\n    /* submit request */\r\n    size_t buf_length = 8 * 1024;\r\n    uint8_t * source = new uint8_t[buf_length];\r\n    memset(source, 'a', buf_length);\r\n\r\n    for (size_t num = 0; num < num_requests; ++num) {\r\n        ret = client.submitRequest(clientHost, host_name, port, source, buf_length);\r\n        EXPECT_EQ(ret, Status::SUCCESS);\r\n        if (ret != Status::SUCCESS) {\r\n            LOG(ERROR) << \"operation=submitrequest error=SubmitRequestError num_active_requests=\"\r\n                << clientHost->numActiveRequests() << std::endl;\r\n        }\r\n//        std::this_thread::sleep_for(std::chrono::milliseconds(100));\r\n        LOG(INFO) << \"operation=submitRequestNverify counter=\" << num << std::endl;\r\n    }\r\n    /* disconnect  */\r\n    ret = client.deleteSession(clientHost);\r\n    EXPECT_EQ(ret, Status::SUCCESS);\r\n    if (ret != Status::SUCCESS) {\r\n        return;\r\n    }\r\n```\r\nHere client doesn't event wait for the response, it goes and cancels the request as part of deleteSession(). On the server side, when the number of clients are 2 or 3, I am getting on_close callbacks but when the concurrency increases upto 50 or so I don't get the on_close callback. \r\n\r\nThe server code is similar like \r\nhttps://github.com/rameshrajagopal/nghttp2_asio_example/blob/master/server/server.cpp. \r\n"},"comment":{"url":"https://api.github.com/repos/tatsuhiro-t/nghttp2/issues/comments/191263404","html_url":"https://github.com/tatsuhiro-t/nghttp2/issues/515#issuecomment-191263404","issue_url":"https://api.github.com/repos/tatsuhiro-t/nghttp2/issues/515","id":191263404,"user":{"login":"rameshrajagopal","id":4286270,"avatar_url":"https://avatars.githubusercontent.com/u/4286270?v=3","gravatar_id":"","url":"https://api.github.com/users/rameshrajagopal","html_url":"https://github.com/rameshrajagopal","followers_url":"https://api.github.com/users/rameshrajagopal/followers","following_url":"https://api.github.com/users/rameshrajagopal/following{/other_user}","gists_url":"https://api.github.com/users/rameshrajagopal/gists{/gist_id}","starred_url":"https://api.github.com/users/rameshrajagopal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rameshrajagopal/subscriptions","organizations_url":"https://api.github.com/users/rameshrajagopal/orgs","repos_url":"https://api.github.com/users/rameshrajagopal/repos","events_url":"https://api.github.com/users/rameshrajagopal/events{/privacy}","received_events_url":"https://api.github.com/users/rameshrajagopal/received_events","type":"User","site_admin":false},"created_at":"2016-03-02T14:41:04Z","updated_at":"2016-03-02T14:41:04Z","body":"@tatsuhiro-t is there any problem the way I handle the problem on the server side, any idea? "}}