{"action":"created","comment":{"url":"https://api.github.com/repos/spinnaker/orca/pulls/comments/179882206","pull_request_review_id":110216610,"id":179882206,"diff_hunk":"@@ -0,0 +1,238 @@\n+package com.netflix.spinnaker.orca.locks;\n+\n+import static net.logstash.logback.argument.StructuredArguments.kv;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.stereotype.Component;\n+import redis.clients.jedis.Jedis;\n+import redis.clients.util.Pool;\n+\n+import java.util.List;\n+import java.util.NoSuchElementException;\n+import java.util.Objects;\n+import java.util.Optional;\n+import java.util.function.Consumer;\n+import java.util.function.Function;\n+\n+import static java.util.Arrays.asList;\n+\n+@Component\n+public class RedisLockManager implements LockManager {","path":"orca-core/src/main/java/com/netflix/spinnaker/locks/RedisLockManager.java","position":21,"original_position":21,"commit_id":"28a31163f4c2c9ad6359cf7935165bb07de2f57d","original_commit_id":"28a31163f4c2c9ad6359cf7935165bb07de2f57d","user":{"login":"robzienert","id":108741,"avatar_url":"https://avatars0.githubusercontent.com/u/108741?v=4","gravatar_id":"","url":"https://api.github.com/users/robzienert","html_url":"https://github.com/robzienert","followers_url":"https://api.github.com/users/robzienert/followers","following_url":"https://api.github.com/users/robzienert/following{/other_user}","gists_url":"https://api.github.com/users/robzienert/gists{/gist_id}","starred_url":"https://api.github.com/users/robzienert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robzienert/subscriptions","organizations_url":"https://api.github.com/users/robzienert/orgs","repos_url":"https://api.github.com/users/robzienert/repos","events_url":"https://api.github.com/users/robzienert/events{/privacy}","received_events_url":"https://api.github.com/users/robzienert/received_events","type":"User","site_admin":false},"body":"Proposal: Let's put this guy into kork-jedis! Do like.","created_at":"2018-04-06T21:40:08Z","updated_at":"2018-04-06T21:40:08Z","html_url":"https://github.com/spinnaker/orca/pull/1799#discussion_r179882206","pull_request_url":"https://api.github.com/repos/spinnaker/orca/pulls/1799","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/spinnaker/orca/pulls/comments/179882206"},"html":{"href":"https://github.com/spinnaker/orca/pull/1799#discussion_r179882206"},"pull_request":{"href":"https://api.github.com/repos/spinnaker/orca/pulls/1799"}}},"pull_request":{"url":"https://api.github.com/repos/spinnaker/orca/pulls/1799","id":152595995,"html_url":"https://github.com/spinnaker/orca/pull/1799","diff_url":"https://github.com/spinnaker/orca/pull/1799.diff","patch_url":"https://github.com/spinnaker/orca/pull/1799.patch","issue_url":"https://api.github.com/repos/spinnaker/orca/issues/1799","number":1799,"state":"open","locked":false,"title":"feat(locking): Adds locking support, cluster locks.","user":{"login":"cfieber","id":301292,"avatar_url":"https://avatars3.githubusercontent.com/u/301292?v=4","gravatar_id":"","url":"https://api.github.com/users/cfieber","html_url":"https://github.com/cfieber","followers_url":"https://api.github.com/users/cfieber/followers","following_url":"https://api.github.com/users/cfieber/following{/other_user}","gists_url":"https://api.github.com/users/cfieber/gists{/gist_id}","starred_url":"https://api.github.com/users/cfieber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfieber/subscriptions","organizations_url":"https://api.github.com/users/cfieber/orgs","repos_url":"https://api.github.com/users/cfieber/repos","events_url":"https://api.github.com/users/cfieber/events{/privacy}","received_events_url":"https://api.github.com/users/cfieber/received_events","type":"User","site_admin":false},"body":"Introduces a generic lock manager and Acquire/Release lock stages.\r\nWires acquire and release lock around cluster based operations, using\r\nthe cluster name (scoped to cloud provider/account/cluster name/region)\r\nas the lock name.\r\n\r\nCluster locks are held by the executing pipeline or orchestration, or\r\nin the case of an executing strategy, by the triggering pipeline.\r\n\r\nThere are several configuration options that can be used to incrementally enable cluster locking to experiment with effects on existing pipelines and user interactions:\r\n\r\nCluster locking is disabled completely by default, but can be enabled with the configuration property:\r\n```yaml\r\nlocking:\r\n  enabled: true\r\n```\r\n\r\nCluster locking will run in learning mode by default where locking failures are non fatal and are just logged:\r\n```yaml\r\nlocking:\r\n  enabled: true\r\n  learningMode: true\r\n```\r\n\r\nCluster locking is not the default behaviour for an execution by default, instead on a per execution basis cluster locking can be enabled by adding an execution flag when submitting the pipeline or orchestration:\r\n```json\r\n{\r\n  \"executionFlags\": {\r\n    \"lockingEnabled\": \"true\"\r\n  },\r\n  \"stages\": [\r\n    \"...\"\r\n  ]\r\n}\r\n```\r\n\r\nCluster locking can be made the default for all executions using a configuration property:\r\n```yaml\r\nlocking:\r\n  enabled: true\r\n  executionDefault: true\r\n```\r\n\r\nWhen cluster locking is the default for all executions, a specific execution can still opt out of it by setting the `\"lockingEnabled\": \"false\"` executionFlag on the pipeline or orchestration.\r\n\r\n\r\n","created_at":"2017-11-14T19:29:27Z","updated_at":"2018-04-06T21:40:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ee12db7a27acbcb9ed33e66614e175284126e931","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/spinnaker/orca/pulls/1799/commits","review_comments_url":"https://api.github.com/repos/spinnaker/orca/pulls/1799/comments","review_comment_url":"https://api.github.com/repos/spinnaker/orca/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spinnaker/orca/issues/1799/comments","statuses_url":"https://api.github.com/repos/spinnaker/orca/statuses/28a31163f4c2c9ad6359cf7935165bb07de2f57d","head":{"label":"cfieber:cluster_lock","ref":"cluster_lock","sha":"28a31163f4c2c9ad6359cf7935165bb07de2f57d","user":{"login":"cfieber","id":301292,"avatar_url":"https://avatars3.githubusercontent.com/u/301292?v=4","gravatar_id":"","url":"https://api.github.com/users/cfieber","html_url":"https://github.com/cfieber","followers_url":"https://api.github.com/users/cfieber/followers","following_url":"https://api.github.com/users/cfieber/following{/other_user}","gists_url":"https://api.github.com/users/cfieber/gists{/gist_id}","starred_url":"https://api.github.com/users/cfieber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfieber/subscriptions","organizations_url":"https://api.github.com/users/cfieber/orgs","repos_url":"https://api.github.com/users/cfieber/repos","events_url":"https://api.github.com/users/cfieber/events{/privacy}","received_events_url":"https://api.github.com/users/cfieber/received_events","type":"User","site_admin":false},"repo":{"id":46649778,"name":"orca","full_name":"cfieber/orca","owner":{"login":"cfieber","id":301292,"avatar_url":"https://avatars3.githubusercontent.com/u/301292?v=4","gravatar_id":"","url":"https://api.github.com/users/cfieber","html_url":"https://github.com/cfieber","followers_url":"https://api.github.com/users/cfieber/followers","following_url":"https://api.github.com/users/cfieber/following{/other_user}","gists_url":"https://api.github.com/users/cfieber/gists{/gist_id}","starred_url":"https://api.github.com/users/cfieber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfieber/subscriptions","organizations_url":"https://api.github.com/users/cfieber/orgs","repos_url":"https://api.github.com/users/cfieber/repos","events_url":"https://api.github.com/users/cfieber/events{/privacy}","received_events_url":"https://api.github.com/users/cfieber/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cfieber/orca","description":"orchestration engine","fork":true,"url":"https://api.github.com/repos/cfieber/orca","forks_url":"https://api.github.com/repos/cfieber/orca/forks","keys_url":"https://api.github.com/repos/cfieber/orca/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cfieber/orca/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cfieber/orca/teams","hooks_url":"https://api.github.com/repos/cfieber/orca/hooks","issue_events_url":"https://api.github.com/repos/cfieber/orca/issues/events{/number}","events_url":"https://api.github.com/repos/cfieber/orca/events","assignees_url":"https://api.github.com/repos/cfieber/orca/assignees{/user}","branches_url":"https://api.github.com/repos/cfieber/orca/branches{/branch}","tags_url":"https://api.github.com/repos/cfieber/orca/tags","blobs_url":"https://api.github.com/repos/cfieber/orca/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cfieber/orca/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cfieber/orca/git/refs{/sha}","trees_url":"https://api.github.com/repos/cfieber/orca/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cfieber/orca/statuses/{sha}","languages_url":"https://api.github.com/repos/cfieber/orca/languages","stargazers_url":"https://api.github.com/repos/cfieber/orca/stargazers","contributors_url":"https://api.github.com/repos/cfieber/orca/contributors","subscribers_url":"https://api.github.com/repos/cfieber/orca/subscribers","subscription_url":"https://api.github.com/repos/cfieber/orca/subscription","commits_url":"https://api.github.com/repos/cfieber/orca/commits{/sha}","git_commits_url":"https://api.github.com/repos/cfieber/orca/git/commits{/sha}","comments_url":"https://api.github.com/repos/cfieber/orca/comments{/number}","issue_comment_url":"https://api.github.com/repos/cfieber/orca/issues/comments{/number}","contents_url":"https://api.github.com/repos/cfieber/orca/contents/{+path}","compare_url":"https://api.github.com/repos/cfieber/orca/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cfieber/orca/merges","archive_url":"https://api.github.com/repos/cfieber/orca/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cfieber/orca/downloads","issues_url":"https://api.github.com/repos/cfieber/orca/issues{/number}","pulls_url":"https://api.github.com/repos/cfieber/orca/pulls{/number}","milestones_url":"https://api.github.com/repos/cfieber/orca/milestones{/number}","notifications_url":"https://api.github.com/repos/cfieber/orca/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cfieber/orca/labels{/name}","releases_url":"https://api.github.com/repos/cfieber/orca/releases{/id}","deployments_url":"https://api.github.com/repos/cfieber/orca/deployments","created_at":"2015-11-22T06:46:30Z","updated_at":"2016-02-09T20:05:40Z","pushed_at":"2018-02-03T00:19:19Z","git_url":"git://github.com/cfieber/orca.git","ssh_url":"git@github.com:cfieber/orca.git","clone_url":"https://github.com/cfieber/orca.git","svn_url":"https://github.com/cfieber/orca","homepage":"","size":10940,"stargazers_count":0,"watchers_count":0,"language":"Groovy","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"spinnaker:master","ref":"master","sha":"3a7f2b1107f69659cc71f5e04ceeb1a9bfb0778e","user":{"login":"spinnaker","id":7634182,"avatar_url":"https://avatars1.githubusercontent.com/u/7634182?v=4","gravatar_id":"","url":"https://api.github.com/users/spinnaker","html_url":"https://github.com/spinnaker","followers_url":"https://api.github.com/users/spinnaker/followers","following_url":"https://api.github.com/users/spinnaker/following{/other_user}","gists_url":"https://api.github.com/users/spinnaker/gists{/gist_id}","starred_url":"https://api.github.com/users/spinnaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spinnaker/subscriptions","organizations_url":"https://api.github.com/users/spinnaker/orgs","repos_url":"https://api.github.com/users/spinnaker/repos","events_url":"https://api.github.com/users/spinnaker/events{/privacy}","received_events_url":"https://api.github.com/users/spinnaker/received_events","type":"Organization","site_admin":false},"repo":{"id":19834314,"name":"orca","full_name":"spinnaker/orca","owner":{"login":"spinnaker","id":7634182,"avatar_url":"https://avatars1.githubusercontent.com/u/7634182?v=4","gravatar_id":"","url":"https://api.github.com/users/spinnaker","html_url":"https://github.com/spinnaker","followers_url":"https://api.github.com/users/spinnaker/followers","following_url":"https://api.github.com/users/spinnaker/following{/other_user}","gists_url":"https://api.github.com/users/spinnaker/gists{/gist_id}","starred_url":"https://api.github.com/users/spinnaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spinnaker/subscriptions","organizations_url":"https://api.github.com/users/spinnaker/orgs","repos_url":"https://api.github.com/users/spinnaker/repos","events_url":"https://api.github.com/users/spinnaker/events{/privacy}","received_events_url":"https://api.github.com/users/spinnaker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spinnaker/orca","description":"orchestration engine","fork":false,"url":"https://api.github.com/repos/spinnaker/orca","forks_url":"https://api.github.com/repos/spinnaker/orca/forks","keys_url":"https://api.github.com/repos/spinnaker/orca/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spinnaker/orca/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spinnaker/orca/teams","hooks_url":"https://api.github.com/repos/spinnaker/orca/hooks","issue_events_url":"https://api.github.com/repos/spinnaker/orca/issues/events{/number}","events_url":"https://api.github.com/repos/spinnaker/orca/events","assignees_url":"https://api.github.com/repos/spinnaker/orca/assignees{/user}","branches_url":"https://api.github.com/repos/spinnaker/orca/branches{/branch}","tags_url":"https://api.github.com/repos/spinnaker/orca/tags","blobs_url":"https://api.github.com/repos/spinnaker/orca/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spinnaker/orca/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spinnaker/orca/git/refs{/sha}","trees_url":"https://api.github.com/repos/spinnaker/orca/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spinnaker/orca/statuses/{sha}","languages_url":"https://api.github.com/repos/spinnaker/orca/languages","stargazers_url":"https://api.github.com/repos/spinnaker/orca/stargazers","contributors_url":"https://api.github.com/repos/spinnaker/orca/contributors","subscribers_url":"https://api.github.com/repos/spinnaker/orca/subscribers","subscription_url":"https://api.github.com/repos/spinnaker/orca/subscription","commits_url":"https://api.github.com/repos/spinnaker/orca/commits{/sha}","git_commits_url":"https://api.github.com/repos/spinnaker/orca/git/commits{/sha}","comments_url":"https://api.github.com/repos/spinnaker/orca/comments{/number}","issue_comment_url":"https://api.github.com/repos/spinnaker/orca/issues/comments{/number}","contents_url":"https://api.github.com/repos/spinnaker/orca/contents/{+path}","compare_url":"https://api.github.com/repos/spinnaker/orca/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spinnaker/orca/merges","archive_url":"https://api.github.com/repos/spinnaker/orca/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spinnaker/orca/downloads","issues_url":"https://api.github.com/repos/spinnaker/orca/issues{/number}","pulls_url":"https://api.github.com/repos/spinnaker/orca/pulls{/number}","milestones_url":"https://api.github.com/repos/spinnaker/orca/milestones{/number}","notifications_url":"https://api.github.com/repos/spinnaker/orca/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spinnaker/orca/labels{/name}","releases_url":"https://api.github.com/repos/spinnaker/orca/releases{/id}","deployments_url":"https://api.github.com/repos/spinnaker/orca/deployments","created_at":"2014-05-15T20:33:00Z","updated_at":"2018-04-06T21:18:17Z","pushed_at":"2018-04-06T21:18:47Z","git_url":"git://github.com/spinnaker/orca.git","ssh_url":"git@github.com:spinnaker/orca.git","clone_url":"https://github.com/spinnaker/orca.git","svn_url":"https://github.com/spinnaker/orca","homepage":"","size":11806,"stargazers_count":88,"watchers_count":88,"language":"Groovy","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":213,"mirror_url":null,"archived":false,"open_issues_count":51,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":213,"open_issues":51,"watchers":88,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spinnaker/orca/pulls/1799"},"html":{"href":"https://github.com/spinnaker/orca/pull/1799"},"issue":{"href":"https://api.github.com/repos/spinnaker/orca/issues/1799"},"comments":{"href":"https://api.github.com/repos/spinnaker/orca/issues/1799/comments"},"review_comments":{"href":"https://api.github.com/repos/spinnaker/orca/pulls/1799/comments"},"review_comment":{"href":"https://api.github.com/repos/spinnaker/orca/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spinnaker/orca/pulls/1799/commits"},"statuses":{"href":"https://api.github.com/repos/spinnaker/orca/statuses/28a31163f4c2c9ad6359cf7935165bb07de2f57d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"robzienert"}}