{"action":"created","comment":{"url":"https://api.github.com/repos/imzhenyu/rDSN/pulls/comments/53118834","id":53118834,"diff_hunk":"@@ -1216,14 +1221,18 @@ void replica_stub::close()\n         while (_closing_replicas.empty() == false)\n         {\n             task_ptr task = _closing_replicas.begin()->second.first;\n+            global_partition_id tmp_gpid = _closing_replicas.begin()->first;\n             _replicas_lock.unlock();\n \n             task->wait();\n \n-\n             _counter_replicas_closing_count.decrement();\n             _replicas_lock.lock();\n-            _closing_replicas.erase(_closing_replicas.begin());\n+            // task will automatically remove this replica from _closing_replicas\n+            if(false == _closing_replicas.empty())","path":"src/dist/replication/lib/replica_stub.cpp","position":null,"original_position":30,"commit_id":"4ff56ebeb19460c41c03fb59cf6c6511c96ba7c4","original_commit_id":"f124c7aeecc9212580e785d6a4651c4277bcb48b","user":{"login":"xiaotz","id":10770438,"avatar_url":"https://avatars.githubusercontent.com/u/10770438?v=3","gravatar_id":"","url":"https://api.github.com/users/xiaotz","html_url":"https://github.com/xiaotz","followers_url":"https://api.github.com/users/xiaotz/followers","following_url":"https://api.github.com/users/xiaotz/following{/other_user}","gists_url":"https://api.github.com/users/xiaotz/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaotz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaotz/subscriptions","organizations_url":"https://api.github.com/users/xiaotz/orgs","repos_url":"https://api.github.com/users/xiaotz/repos","events_url":"https://api.github.com/users/xiaotz/events{/privacy}","received_events_url":"https://api.github.com/users/xiaotz/received_events","type":"User","site_admin":false},"body":"fixed\r\n","created_at":"2016-02-17T04:04:34Z","updated_at":"2016-02-17T04:04:34Z","html_url":"https://github.com/imzhenyu/rDSN/pull/295#discussion_r53118834","pull_request_url":"https://api.github.com/repos/imzhenyu/rDSN/pulls/295","_links":{"self":{"href":"https://api.github.com/repos/imzhenyu/rDSN/pulls/comments/53118834"},"html":{"href":"https://github.com/imzhenyu/rDSN/pull/295#discussion_r53118834"},"pull_request":{"href":"https://api.github.com/repos/imzhenyu/rDSN/pulls/295"}}},"pull_request":{"url":"https://api.github.com/repos/imzhenyu/rDSN/pulls/295","id":59590603,"html_url":"https://github.com/imzhenyu/rDSN/pull/295","diff_url":"https://github.com/imzhenyu/rDSN/pull/295.diff","patch_url":"https://github.com/imzhenyu/rDSN/pull/295.patch","issue_url":"https://api.github.com/repos/imzhenyu/rDSN/issues/295","number":295,"state":"open","locked":false,"title":"fix some bugs","user":{"login":"xiaotz","id":10770438,"avatar_url":"https://avatars.githubusercontent.com/u/10770438?v=3","gravatar_id":"","url":"https://api.github.com/users/xiaotz","html_url":"https://github.com/xiaotz","followers_url":"https://api.github.com/users/xiaotz/followers","following_url":"https://api.github.com/users/xiaotz/following{/other_user}","gists_url":"https://api.github.com/users/xiaotz/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaotz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaotz/subscriptions","organizations_url":"https://api.github.com/users/xiaotz/orgs","repos_url":"https://api.github.com/users/xiaotz/repos","events_url":"https://api.github.com/users/xiaotz/events{/privacy}","received_events_url":"https://api.github.com/users/xiaotz/received_events","type":"User","site_admin":false},"body":"the test will core dump when exit.\r\n","created_at":"2016-02-17T03:10:57Z","updated_at":"2016-02-17T04:04:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"569bbf78c486f80d6bf3f17d36efac63fcc93ed0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/imzhenyu/rDSN/pulls/295/commits","review_comments_url":"https://api.github.com/repos/imzhenyu/rDSN/pulls/295/comments","review_comment_url":"https://api.github.com/repos/imzhenyu/rDSN/pulls/comments{/number}","comments_url":"https://api.github.com/repos/imzhenyu/rDSN/issues/295/comments","statuses_url":"https://api.github.com/repos/imzhenyu/rDSN/statuses/4ff56ebeb19460c41c03fb59cf6c6511c96ba7c4","head":{"label":"xiaotz:bugfix","ref":"bugfix","sha":"4ff56ebeb19460c41c03fb59cf6c6511c96ba7c4","user":{"login":"xiaotz","id":10770438,"avatar_url":"https://avatars.githubusercontent.com/u/10770438?v=3","gravatar_id":"","url":"https://api.github.com/users/xiaotz","html_url":"https://github.com/xiaotz","followers_url":"https://api.github.com/users/xiaotz/followers","following_url":"https://api.github.com/users/xiaotz/following{/other_user}","gists_url":"https://api.github.com/users/xiaotz/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaotz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaotz/subscriptions","organizations_url":"https://api.github.com/users/xiaotz/orgs","repos_url":"https://api.github.com/users/xiaotz/repos","events_url":"https://api.github.com/users/xiaotz/events{/privacy}","received_events_url":"https://api.github.com/users/xiaotz/received_events","type":"User","site_admin":false},"repo":{"id":47963937,"name":"rDSN","full_name":"xiaotz/rDSN","owner":{"login":"xiaotz","id":10770438,"avatar_url":"https://avatars.githubusercontent.com/u/10770438?v=3","gravatar_id":"","url":"https://api.github.com/users/xiaotz","html_url":"https://github.com/xiaotz","followers_url":"https://api.github.com/users/xiaotz/followers","following_url":"https://api.github.com/users/xiaotz/following{/other_user}","gists_url":"https://api.github.com/users/xiaotz/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaotz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaotz/subscriptions","organizations_url":"https://api.github.com/users/xiaotz/orgs","repos_url":"https://api.github.com/users/xiaotz/repos","events_url":"https://api.github.com/users/xiaotz/events{/privacy}","received_events_url":"https://api.github.com/users/xiaotz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xiaotz/rDSN","description":"Robust Distributed System Nucleus (rDSN) is an open framework for quickly building and managing high performance and robust distributed systems.","fork":true,"url":"https://api.github.com/repos/xiaotz/rDSN","forks_url":"https://api.github.com/repos/xiaotz/rDSN/forks","keys_url":"https://api.github.com/repos/xiaotz/rDSN/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xiaotz/rDSN/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xiaotz/rDSN/teams","hooks_url":"https://api.github.com/repos/xiaotz/rDSN/hooks","issue_events_url":"https://api.github.com/repos/xiaotz/rDSN/issues/events{/number}","events_url":"https://api.github.com/repos/xiaotz/rDSN/events","assignees_url":"https://api.github.com/repos/xiaotz/rDSN/assignees{/user}","branches_url":"https://api.github.com/repos/xiaotz/rDSN/branches{/branch}","tags_url":"https://api.github.com/repos/xiaotz/rDSN/tags","blobs_url":"https://api.github.com/repos/xiaotz/rDSN/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xiaotz/rDSN/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xiaotz/rDSN/git/refs{/sha}","trees_url":"https://api.github.com/repos/xiaotz/rDSN/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xiaotz/rDSN/statuses/{sha}","languages_url":"https://api.github.com/repos/xiaotz/rDSN/languages","stargazers_url":"https://api.github.com/repos/xiaotz/rDSN/stargazers","contributors_url":"https://api.github.com/repos/xiaotz/rDSN/contributors","subscribers_url":"https://api.github.com/repos/xiaotz/rDSN/subscribers","subscription_url":"https://api.github.com/repos/xiaotz/rDSN/subscription","commits_url":"https://api.github.com/repos/xiaotz/rDSN/commits{/sha}","git_commits_url":"https://api.github.com/repos/xiaotz/rDSN/git/commits{/sha}","comments_url":"https://api.github.com/repos/xiaotz/rDSN/comments{/number}","issue_comment_url":"https://api.github.com/repos/xiaotz/rDSN/issues/comments{/number}","contents_url":"https://api.github.com/repos/xiaotz/rDSN/contents/{+path}","compare_url":"https://api.github.com/repos/xiaotz/rDSN/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xiaotz/rDSN/merges","archive_url":"https://api.github.com/repos/xiaotz/rDSN/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xiaotz/rDSN/downloads","issues_url":"https://api.github.com/repos/xiaotz/rDSN/issues{/number}","pulls_url":"https://api.github.com/repos/xiaotz/rDSN/pulls{/number}","milestones_url":"https://api.github.com/repos/xiaotz/rDSN/milestones{/number}","notifications_url":"https://api.github.com/repos/xiaotz/rDSN/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xiaotz/rDSN/labels{/name}","releases_url":"https://api.github.com/repos/xiaotz/rDSN/releases{/id}","deployments_url":"https://api.github.com/repos/xiaotz/rDSN/deployments","created_at":"2015-12-14T09:12:32Z","updated_at":"2015-12-14T09:12:34Z","pushed_at":"2016-02-17T04:03:51Z","git_url":"git://github.com/xiaotz/rDSN.git","ssh_url":"git@github.com:xiaotz/rDSN.git","clone_url":"https://github.com/xiaotz/rDSN.git","svn_url":"https://github.com/xiaotz/rDSN","homepage":null,"size":52944,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"imzhenyu:master","ref":"master","sha":"28f978e7cedab652fcf043c1e2277ffc5cf23857","user":{"login":"imzhenyu","id":6927143,"avatar_url":"https://avatars.githubusercontent.com/u/6927143?v=3","gravatar_id":"","url":"https://api.github.com/users/imzhenyu","html_url":"https://github.com/imzhenyu","followers_url":"https://api.github.com/users/imzhenyu/followers","following_url":"https://api.github.com/users/imzhenyu/following{/other_user}","gists_url":"https://api.github.com/users/imzhenyu/gists{/gist_id}","starred_url":"https://api.github.com/users/imzhenyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imzhenyu/subscriptions","organizations_url":"https://api.github.com/users/imzhenyu/orgs","repos_url":"https://api.github.com/users/imzhenyu/repos","events_url":"https://api.github.com/users/imzhenyu/events{/privacy}","received_events_url":"https://api.github.com/users/imzhenyu/received_events","type":"User","site_admin":false},"repo":{"id":37038578,"name":"rDSN","full_name":"imzhenyu/rDSN","owner":{"login":"imzhenyu","id":6927143,"avatar_url":"https://avatars.githubusercontent.com/u/6927143?v=3","gravatar_id":"","url":"https://api.github.com/users/imzhenyu","html_url":"https://github.com/imzhenyu","followers_url":"https://api.github.com/users/imzhenyu/followers","following_url":"https://api.github.com/users/imzhenyu/following{/other_user}","gists_url":"https://api.github.com/users/imzhenyu/gists{/gist_id}","starred_url":"https://api.github.com/users/imzhenyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imzhenyu/subscriptions","organizations_url":"https://api.github.com/users/imzhenyu/orgs","repos_url":"https://api.github.com/users/imzhenyu/repos","events_url":"https://api.github.com/users/imzhenyu/events{/privacy}","received_events_url":"https://api.github.com/users/imzhenyu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/imzhenyu/rDSN","description":"Robust Distributed System Nucleus (rDSN) is an open framework for quickly building and managing high performance and robust distributed systems.","fork":true,"url":"https://api.github.com/repos/imzhenyu/rDSN","forks_url":"https://api.github.com/repos/imzhenyu/rDSN/forks","keys_url":"https://api.github.com/repos/imzhenyu/rDSN/keys{/key_id}","collaborators_url":"https://api.github.com/repos/imzhenyu/rDSN/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/imzhenyu/rDSN/teams","hooks_url":"https://api.github.com/repos/imzhenyu/rDSN/hooks","issue_events_url":"https://api.github.com/repos/imzhenyu/rDSN/issues/events{/number}","events_url":"https://api.github.com/repos/imzhenyu/rDSN/events","assignees_url":"https://api.github.com/repos/imzhenyu/rDSN/assignees{/user}","branches_url":"https://api.github.com/repos/imzhenyu/rDSN/branches{/branch}","tags_url":"https://api.github.com/repos/imzhenyu/rDSN/tags","blobs_url":"https://api.github.com/repos/imzhenyu/rDSN/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/imzhenyu/rDSN/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/imzhenyu/rDSN/git/refs{/sha}","trees_url":"https://api.github.com/repos/imzhenyu/rDSN/git/trees{/sha}","statuses_url":"https://api.github.com/repos/imzhenyu/rDSN/statuses/{sha}","languages_url":"https://api.github.com/repos/imzhenyu/rDSN/languages","stargazers_url":"https://api.github.com/repos/imzhenyu/rDSN/stargazers","contributors_url":"https://api.github.com/repos/imzhenyu/rDSN/contributors","subscribers_url":"https://api.github.com/repos/imzhenyu/rDSN/subscribers","subscription_url":"https://api.github.com/repos/imzhenyu/rDSN/subscription","commits_url":"https://api.github.com/repos/imzhenyu/rDSN/commits{/sha}","git_commits_url":"https://api.github.com/repos/imzhenyu/rDSN/git/commits{/sha}","comments_url":"https://api.github.com/repos/imzhenyu/rDSN/comments{/number}","issue_comment_url":"https://api.github.com/repos/imzhenyu/rDSN/issues/comments{/number}","contents_url":"https://api.github.com/repos/imzhenyu/rDSN/contents/{+path}","compare_url":"https://api.github.com/repos/imzhenyu/rDSN/compare/{base}...{head}","merges_url":"https://api.github.com/repos/imzhenyu/rDSN/merges","archive_url":"https://api.github.com/repos/imzhenyu/rDSN/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/imzhenyu/rDSN/downloads","issues_url":"https://api.github.com/repos/imzhenyu/rDSN/issues{/number}","pulls_url":"https://api.github.com/repos/imzhenyu/rDSN/pulls{/number}","milestones_url":"https://api.github.com/repos/imzhenyu/rDSN/milestones{/number}","notifications_url":"https://api.github.com/repos/imzhenyu/rDSN/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/imzhenyu/rDSN/labels{/name}","releases_url":"https://api.github.com/repos/imzhenyu/rDSN/releases{/id}","deployments_url":"https://api.github.com/repos/imzhenyu/rDSN/deployments","created_at":"2015-06-08T00:54:11Z","updated_at":"2016-02-15T07:20:24Z","pushed_at":"2016-02-17T04:03:51Z","git_url":"git://github.com/imzhenyu/rDSN.git","ssh_url":"git@github.com:imzhenyu/rDSN.git","clone_url":"https://github.com/imzhenyu/rDSN.git","svn_url":"https://github.com/imzhenyu/rDSN","homepage":null,"size":55925,"stargazers_count":7,"watchers_count":7,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":7,"mirror_url":null,"open_issues_count":34,"forks":7,"open_issues":34,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/imzhenyu/rDSN/pulls/295"},"html":{"href":"https://github.com/imzhenyu/rDSN/pull/295"},"issue":{"href":"https://api.github.com/repos/imzhenyu/rDSN/issues/295"},"comments":{"href":"https://api.github.com/repos/imzhenyu/rDSN/issues/295/comments"},"review_comments":{"href":"https://api.github.com/repos/imzhenyu/rDSN/pulls/295/comments"},"review_comment":{"href":"https://api.github.com/repos/imzhenyu/rDSN/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/imzhenyu/rDSN/pulls/295/commits"},"statuses":{"href":"https://api.github.com/repos/imzhenyu/rDSN/statuses/4ff56ebeb19460c41c03fb59cf6c6511c96ba7c4"}}}}