{"action":"created","comment":{"url":"https://api.github.com/repos/eclipse/che/pulls/comments/126091238","pull_request_review_id":48543041,"id":126091238,"diff_hunk":"@@ -249,48 +264,45 @@ public Runtime get(String workspaceId) throws NotFoundException, ServerException\n     public void stop(String workspaceId, Map<String, String> options) throws NotFoundException,\n                                                                              InfrastructureException,\n                                                                              ConflictException {\n-\n+        RuntimeState state = runtimes.get(workspaceId);\n+        if (state == null) {\n+            throw new NotFoundException(\"Workspace with id '\" + workspaceId + \"' is not running.\");\n+        }\n+        if (!state.status.equals(RUNNING)) {\n+            throw new ConflictException(\n+                    format(\"Could not start workspace '%s' because its state is '%s'\", workspaceId, state.status));\n+        }\n+        runtimes.replace(workspaceId, new RuntimeState(state.runtime, STOPPING));","path":"wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/WorkspaceRuntimes.java","position":171,"original_position":171,"commit_id":"48f875f1af418ec6196221ebdbc5d7eb2e0220ec","original_commit_id":"19b6b5a228f75fda8399b8addbb7793fe851d00e","user":{"login":"garagatyi","id":1851863,"avatar_url":"https://avatars3.githubusercontent.com/u/1851863?v=3","gravatar_id":"","url":"https://api.github.com/users/garagatyi","html_url":"https://github.com/garagatyi","followers_url":"https://api.github.com/users/garagatyi/followers","following_url":"https://api.github.com/users/garagatyi/following{/other_user}","gists_url":"https://api.github.com/users/garagatyi/gists{/gist_id}","starred_url":"https://api.github.com/users/garagatyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garagatyi/subscriptions","organizations_url":"https://api.github.com/users/garagatyi/orgs","repos_url":"https://api.github.com/users/garagatyi/repos","events_url":"https://api.github.com/users/garagatyi/events{/privacy}","received_events_url":"https://api.github.com/users/garagatyi/received_events","type":"User","site_admin":false},"body":"There is no guarantee that objects will be equal. Some of the fields might change in the process of start, so it really depends on equal method implementation","created_at":"2017-07-07T08:10:44Z","updated_at":"2017-07-07T08:10:44Z","html_url":"https://github.com/eclipse/che/pull/5551#discussion_r126091238","pull_request_url":"https://api.github.com/repos/eclipse/che/pulls/5551","_links":{"self":{"href":"https://api.github.com/repos/eclipse/che/pulls/comments/126091238"},"html":{"href":"https://github.com/eclipse/che/pull/5551#discussion_r126091238"},"pull_request":{"href":"https://api.github.com/repos/eclipse/che/pulls/5551"}}},"pull_request":{"url":"https://api.github.com/repos/eclipse/che/pulls/5551","id":129166065,"html_url":"https://github.com/eclipse/che/pull/5551","diff_url":"https://github.com/eclipse/che/pull/5551.diff","patch_url":"https://github.com/eclipse/che/pull/5551.patch","issue_url":"https://api.github.com/repos/eclipse/che/issues/5551","number":5551,"state":"open","locked":false,"title":"Stop Docker runtime in case of running runtime error","user":{"login":"garagatyi","id":1851863,"avatar_url":"https://avatars3.githubusercontent.com/u/1851863?v=3","gravatar_id":"","url":"https://api.github.com/users/garagatyi","html_url":"https://github.com/garagatyi","followers_url":"https://api.github.com/users/garagatyi/followers","following_url":"https://api.github.com/users/garagatyi/following{/other_user}","gists_url":"https://api.github.com/users/garagatyi/gists{/gist_id}","starred_url":"https://api.github.com/users/garagatyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garagatyi/subscriptions","organizations_url":"https://api.github.com/users/garagatyi/orgs","repos_url":"https://api.github.com/users/garagatyi/repos","events_url":"https://api.github.com/users/garagatyi/events{/privacy}","received_events_url":"https://api.github.com/users/garagatyi/received_events","type":"User","site_admin":false},"body":"This change is relevant to the spi branch only.\r\n### What does this PR do?\r\nStop Docker runtime in case of running runtime error.\r\nMove workspace statuses management to WorkspaceRuntimes.\r\n\r\n### What issues does this PR fix or reference?\r\nFixes #5419 \r\n\r\n","created_at":"2017-07-06T11:46:58Z","updated_at":"2017-07-07T08:10:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b1a622ab04f0dbcd3e8b6e4be8f1a88f569f9cff","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/eclipse/che/pulls/5551/commits","review_comments_url":"https://api.github.com/repos/eclipse/che/pulls/5551/comments","review_comment_url":"https://api.github.com/repos/eclipse/che/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eclipse/che/issues/5551/comments","statuses_url":"https://api.github.com/repos/eclipse/che/statuses/48f875f1af418ec6196221ebdbc5d7eb2e0220ec","head":{"label":"garagatyi:SpiOOM","ref":"SpiOOM","sha":"48f875f1af418ec6196221ebdbc5d7eb2e0220ec","user":{"login":"garagatyi","id":1851863,"avatar_url":"https://avatars3.githubusercontent.com/u/1851863?v=3","gravatar_id":"","url":"https://api.github.com/users/garagatyi","html_url":"https://github.com/garagatyi","followers_url":"https://api.github.com/users/garagatyi/followers","following_url":"https://api.github.com/users/garagatyi/following{/other_user}","gists_url":"https://api.github.com/users/garagatyi/gists{/gist_id}","starred_url":"https://api.github.com/users/garagatyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garagatyi/subscriptions","organizations_url":"https://api.github.com/users/garagatyi/orgs","repos_url":"https://api.github.com/users/garagatyi/repos","events_url":"https://api.github.com/users/garagatyi/events{/privacy}","received_events_url":"https://api.github.com/users/garagatyi/received_events","type":"User","site_admin":false},"repo":{"id":61277813,"name":"che","full_name":"garagatyi/che","owner":{"login":"garagatyi","id":1851863,"avatar_url":"https://avatars3.githubusercontent.com/u/1851863?v=3","gravatar_id":"","url":"https://api.github.com/users/garagatyi","html_url":"https://github.com/garagatyi","followers_url":"https://api.github.com/users/garagatyi/followers","following_url":"https://api.github.com/users/garagatyi/following{/other_user}","gists_url":"https://api.github.com/users/garagatyi/gists{/gist_id}","starred_url":"https://api.github.com/users/garagatyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garagatyi/subscriptions","organizations_url":"https://api.github.com/users/garagatyi/orgs","repos_url":"https://api.github.com/users/garagatyi/repos","events_url":"https://api.github.com/users/garagatyi/events{/privacy}","received_events_url":"https://api.github.com/users/garagatyi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/garagatyi/che","description":"Eclipse Che: Next-generation Eclipse IDE.  Open source workspace server and cloud IDE.","fork":true,"url":"https://api.github.com/repos/garagatyi/che","forks_url":"https://api.github.com/repos/garagatyi/che/forks","keys_url":"https://api.github.com/repos/garagatyi/che/keys{/key_id}","collaborators_url":"https://api.github.com/repos/garagatyi/che/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/garagatyi/che/teams","hooks_url":"https://api.github.com/repos/garagatyi/che/hooks","issue_events_url":"https://api.github.com/repos/garagatyi/che/issues/events{/number}","events_url":"https://api.github.com/repos/garagatyi/che/events","assignees_url":"https://api.github.com/repos/garagatyi/che/assignees{/user}","branches_url":"https://api.github.com/repos/garagatyi/che/branches{/branch}","tags_url":"https://api.github.com/repos/garagatyi/che/tags","blobs_url":"https://api.github.com/repos/garagatyi/che/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/garagatyi/che/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/garagatyi/che/git/refs{/sha}","trees_url":"https://api.github.com/repos/garagatyi/che/git/trees{/sha}","statuses_url":"https://api.github.com/repos/garagatyi/che/statuses/{sha}","languages_url":"https://api.github.com/repos/garagatyi/che/languages","stargazers_url":"https://api.github.com/repos/garagatyi/che/stargazers","contributors_url":"https://api.github.com/repos/garagatyi/che/contributors","subscribers_url":"https://api.github.com/repos/garagatyi/che/subscribers","subscription_url":"https://api.github.com/repos/garagatyi/che/subscription","commits_url":"https://api.github.com/repos/garagatyi/che/commits{/sha}","git_commits_url":"https://api.github.com/repos/garagatyi/che/git/commits{/sha}","comments_url":"https://api.github.com/repos/garagatyi/che/comments{/number}","issue_comment_url":"https://api.github.com/repos/garagatyi/che/issues/comments{/number}","contents_url":"https://api.github.com/repos/garagatyi/che/contents/{+path}","compare_url":"https://api.github.com/repos/garagatyi/che/compare/{base}...{head}","merges_url":"https://api.github.com/repos/garagatyi/che/merges","archive_url":"https://api.github.com/repos/garagatyi/che/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/garagatyi/che/downloads","issues_url":"https://api.github.com/repos/garagatyi/che/issues{/number}","pulls_url":"https://api.github.com/repos/garagatyi/che/pulls{/number}","milestones_url":"https://api.github.com/repos/garagatyi/che/milestones{/number}","notifications_url":"https://api.github.com/repos/garagatyi/che/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/garagatyi/che/labels{/name}","releases_url":"https://api.github.com/repos/garagatyi/che/releases{/id}","deployments_url":"https://api.github.com/repos/garagatyi/che/deployments","created_at":"2016-06-16T08:56:55Z","updated_at":"2016-12-06T07:37:56Z","pushed_at":"2017-07-07T07:56:01Z","git_url":"git://github.com/garagatyi/che.git","ssh_url":"git@github.com:garagatyi/che.git","clone_url":"https://github.com/garagatyi/che.git","svn_url":"https://github.com/garagatyi/che","homepage":"http://eclipse.org/che","size":45790,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"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":"falseDefaultBranch"}},"base":{"label":"eclipse:spi","ref":"spi","sha":"a1dfdfb04ef7f3369c8d313dbcd1992e22f3b244","user":{"login":"eclipse","id":56974,"avatar_url":"https://avatars2.githubusercontent.com/u/56974?v=3","gravatar_id":"","url":"https://api.github.com/users/eclipse","html_url":"https://github.com/eclipse","followers_url":"https://api.github.com/users/eclipse/followers","following_url":"https://api.github.com/users/eclipse/following{/other_user}","gists_url":"https://api.github.com/users/eclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/eclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclipse/subscriptions","organizations_url":"https://api.github.com/users/eclipse/orgs","repos_url":"https://api.github.com/users/eclipse/repos","events_url":"https://api.github.com/users/eclipse/events{/privacy}","received_events_url":"https://api.github.com/users/eclipse/received_events","type":"Organization","site_admin":false},"repo":{"id":32935745,"name":"che","full_name":"eclipse/che","owner":{"login":"eclipse","id":56974,"avatar_url":"https://avatars2.githubusercontent.com/u/56974?v=3","gravatar_id":"","url":"https://api.github.com/users/eclipse","html_url":"https://github.com/eclipse","followers_url":"https://api.github.com/users/eclipse/followers","following_url":"https://api.github.com/users/eclipse/following{/other_user}","gists_url":"https://api.github.com/users/eclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/eclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclipse/subscriptions","organizations_url":"https://api.github.com/users/eclipse/orgs","repos_url":"https://api.github.com/users/eclipse/repos","events_url":"https://api.github.com/users/eclipse/events{/privacy}","received_events_url":"https://api.github.com/users/eclipse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eclipse/che","description":"Eclipse Che: Next-generation Eclipse IDE.  Open source workspace server and cloud IDE.","fork":false,"url":"https://api.github.com/repos/eclipse/che","forks_url":"https://api.github.com/repos/eclipse/che/forks","keys_url":"https://api.github.com/repos/eclipse/che/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eclipse/che/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eclipse/che/teams","hooks_url":"https://api.github.com/repos/eclipse/che/hooks","issue_events_url":"https://api.github.com/repos/eclipse/che/issues/events{/number}","events_url":"https://api.github.com/repos/eclipse/che/events","assignees_url":"https://api.github.com/repos/eclipse/che/assignees{/user}","branches_url":"https://api.github.com/repos/eclipse/che/branches{/branch}","tags_url":"https://api.github.com/repos/eclipse/che/tags","blobs_url":"https://api.github.com/repos/eclipse/che/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eclipse/che/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eclipse/che/git/refs{/sha}","trees_url":"https://api.github.com/repos/eclipse/che/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eclipse/che/statuses/{sha}","languages_url":"https://api.github.com/repos/eclipse/che/languages","stargazers_url":"https://api.github.com/repos/eclipse/che/stargazers","contributors_url":"https://api.github.com/repos/eclipse/che/contributors","subscribers_url":"https://api.github.com/repos/eclipse/che/subscribers","subscription_url":"https://api.github.com/repos/eclipse/che/subscription","commits_url":"https://api.github.com/repos/eclipse/che/commits{/sha}","git_commits_url":"https://api.github.com/repos/eclipse/che/git/commits{/sha}","comments_url":"https://api.github.com/repos/eclipse/che/comments{/number}","issue_comment_url":"https://api.github.com/repos/eclipse/che/issues/comments{/number}","contents_url":"https://api.github.com/repos/eclipse/che/contents/{+path}","compare_url":"https://api.github.com/repos/eclipse/che/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eclipse/che/merges","archive_url":"https://api.github.com/repos/eclipse/che/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eclipse/che/downloads","issues_url":"https://api.github.com/repos/eclipse/che/issues{/number}","pulls_url":"https://api.github.com/repos/eclipse/che/pulls{/number}","milestones_url":"https://api.github.com/repos/eclipse/che/milestones{/number}","notifications_url":"https://api.github.com/repos/eclipse/che/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eclipse/che/labels{/name}","releases_url":"https://api.github.com/repos/eclipse/che/releases{/id}","deployments_url":"https://api.github.com/repos/eclipse/che/deployments","created_at":"2015-03-26T15:31:01Z","updated_at":"2017-07-06T15:19:43Z","pushed_at":"2017-07-07T07:56:04Z","git_url":"git://github.com/eclipse/che.git","ssh_url":"git@github.com:eclipse/che.git","clone_url":"https://github.com/eclipse/che.git","svn_url":"https://github.com/eclipse/che","homepage":"http://eclipse.org/che","size":51723,"stargazers_count":4220,"watchers_count":4220,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":700,"mirror_url":null,"open_issues_count":465,"forks":700,"open_issues":465,"watchers":4220,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eclipse/che/pulls/5551"},"html":{"href":"https://github.com/eclipse/che/pull/5551"},"issue":{"href":"https://api.github.com/repos/eclipse/che/issues/5551"},"comments":{"href":"https://api.github.com/repos/eclipse/che/issues/5551/comments"},"review_comments":{"href":"https://api.github.com/repos/eclipse/che/pulls/5551/comments"},"review_comment":{"href":"https://api.github.com/repos/eclipse/che/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eclipse/che/pulls/5551/commits"},"statuses":{"href":"https://api.github.com/repos/eclipse/che/statuses/48f875f1af418ec6196221ebdbc5d7eb2e0220ec"}}}}
{"actor":{"display_login":"garagatyi"}}