{"action":"opened","number":8,"pull_request":{"url":"https://api.github.com/repos/Tieske/uuid/pulls/8","id":63679514,"html_url":"https://github.com/Tieske/uuid/pull/8","diff_url":"https://github.com/Tieske/uuid/pull/8.diff","patch_url":"https://github.com/Tieske/uuid/pull/8.patch","issue_url":"https://api.github.com/repos/Tieske/uuid/issues/8","number":8,"state":"open","locked":false,"title":"feat: new seeding technique when in ngx_lua","user":{"login":"thibaultCha","id":1125431,"avatar_url":"https://avatars.githubusercontent.com/u/1125431?v=3","gravatar_id":"","url":"https://api.github.com/users/thibaultCha","html_url":"https://github.com/thibaultCha","followers_url":"https://api.github.com/users/thibaultCha/followers","following_url":"https://api.github.com/users/thibaultCha/following{/other_user}","gists_url":"https://api.github.com/users/thibaultCha/gists{/gist_id}","starred_url":"https://api.github.com/users/thibaultCha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thibaultCha/subscriptions","organizations_url":"https://api.github.com/users/thibaultCha/orgs","repos_url":"https://api.github.com/users/thibaultCha/repos","events_url":"https://api.github.com/users/thibaultCha/events{/privacy}","received_events_url":"https://api.github.com/users/thibaultCha/received_events","type":"User","site_admin":false},"body":"- Adds a higher-priority random seeding technique if in ngx_lua to ensure\r\nunique seeds for all workers.\r\n- Reorders the documentation to reflect priority for the seeding\r\ntechnique.\r\n\r\nI tested this with:\r\n\r\n```nginx\r\nworker_processes auto;\r\nerror_log logs/error.log notice;\r\ndaemon on;\r\n\r\nevents {}\r\n\r\nhttp {\r\n  lua_shared_dict uuids 128m;\r\n\r\n  init_worker_by_lua_block {\r\n    local uuid = require \"uuid\"\r\n    uuid.seed()\r\n  }\r\n\r\n  server {\r\n    listen 9000;\r\n\r\n    location / {\r\n      content_by_lua_block {\r\n        local uuid = require \"uuid\"\r\n        local dict = ngx.shared.uuids\r\n\r\n        local u = uuid()\r\n\r\n        if dict:get(u) then\r\n          ngx.log(ngx.ERR, u..\" already exists\")\r\n          ngx.exit(500)\r\n        end\r\n\r\n        assert(dict:set(u, true))\r\n        ngx.say(u)\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nAnd hitting it with:\r\n\r\n```bash\r\n$ wrk -t8 -c100 -d60s http://localhost:9000\r\n```\r\n\r\nAs expected, the original seeding technique results in conflicts as soon as a second worker is hit, and the conflicts are constant from this point. With the PID technique, no conflicts occurred.","created_at":"2016-03-22T07:29:42Z","updated_at":"2016-03-22T07:29:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Tieske/uuid/pulls/8/commits","review_comments_url":"https://api.github.com/repos/Tieske/uuid/pulls/8/comments","review_comment_url":"https://api.github.com/repos/Tieske/uuid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Tieske/uuid/issues/8/comments","statuses_url":"https://api.github.com/repos/Tieske/uuid/statuses/40e93312d272e08b3d9723e720273b609ab7ad05","head":{"label":"thibaultCha:feat/ngx-seeding","ref":"feat/ngx-seeding","sha":"40e93312d272e08b3d9723e720273b609ab7ad05","user":{"login":"thibaultCha","id":1125431,"avatar_url":"https://avatars.githubusercontent.com/u/1125431?v=3","gravatar_id":"","url":"https://api.github.com/users/thibaultCha","html_url":"https://github.com/thibaultCha","followers_url":"https://api.github.com/users/thibaultCha/followers","following_url":"https://api.github.com/users/thibaultCha/following{/other_user}","gists_url":"https://api.github.com/users/thibaultCha/gists{/gist_id}","starred_url":"https://api.github.com/users/thibaultCha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thibaultCha/subscriptions","organizations_url":"https://api.github.com/users/thibaultCha/orgs","repos_url":"https://api.github.com/users/thibaultCha/repos","events_url":"https://api.github.com/users/thibaultCha/events{/privacy}","received_events_url":"https://api.github.com/users/thibaultCha/received_events","type":"User","site_admin":false},"repo":{"id":54453649,"name":"uuid","full_name":"thibaultCha/uuid","owner":{"login":"thibaultCha","id":1125431,"avatar_url":"https://avatars.githubusercontent.com/u/1125431?v=3","gravatar_id":"","url":"https://api.github.com/users/thibaultCha","html_url":"https://github.com/thibaultCha","followers_url":"https://api.github.com/users/thibaultCha/followers","following_url":"https://api.github.com/users/thibaultCha/following{/other_user}","gists_url":"https://api.github.com/users/thibaultCha/gists{/gist_id}","starred_url":"https://api.github.com/users/thibaultCha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thibaultCha/subscriptions","organizations_url":"https://api.github.com/users/thibaultCha/orgs","repos_url":"https://api.github.com/users/thibaultCha/repos","events_url":"https://api.github.com/users/thibaultCha/events{/privacy}","received_events_url":"https://api.github.com/users/thibaultCha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thibaultCha/uuid","description":"A pure Lua uuid generator (modified from a Rackspace module)","fork":true,"url":"https://api.github.com/repos/thibaultCha/uuid","forks_url":"https://api.github.com/repos/thibaultCha/uuid/forks","keys_url":"https://api.github.com/repos/thibaultCha/uuid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thibaultCha/uuid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thibaultCha/uuid/teams","hooks_url":"https://api.github.com/repos/thibaultCha/uuid/hooks","issue_events_url":"https://api.github.com/repos/thibaultCha/uuid/issues/events{/number}","events_url":"https://api.github.com/repos/thibaultCha/uuid/events","assignees_url":"https://api.github.com/repos/thibaultCha/uuid/assignees{/user}","branches_url":"https://api.github.com/repos/thibaultCha/uuid/branches{/branch}","tags_url":"https://api.github.com/repos/thibaultCha/uuid/tags","blobs_url":"https://api.github.com/repos/thibaultCha/uuid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thibaultCha/uuid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thibaultCha/uuid/git/refs{/sha}","trees_url":"https://api.github.com/repos/thibaultCha/uuid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thibaultCha/uuid/statuses/{sha}","languages_url":"https://api.github.com/repos/thibaultCha/uuid/languages","stargazers_url":"https://api.github.com/repos/thibaultCha/uuid/stargazers","contributors_url":"https://api.github.com/repos/thibaultCha/uuid/contributors","subscribers_url":"https://api.github.com/repos/thibaultCha/uuid/subscribers","subscription_url":"https://api.github.com/repos/thibaultCha/uuid/subscription","commits_url":"https://api.github.com/repos/thibaultCha/uuid/commits{/sha}","git_commits_url":"https://api.github.com/repos/thibaultCha/uuid/git/commits{/sha}","comments_url":"https://api.github.com/repos/thibaultCha/uuid/comments{/number}","issue_comment_url":"https://api.github.com/repos/thibaultCha/uuid/issues/comments{/number}","contents_url":"https://api.github.com/repos/thibaultCha/uuid/contents/{+path}","compare_url":"https://api.github.com/repos/thibaultCha/uuid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thibaultCha/uuid/merges","archive_url":"https://api.github.com/repos/thibaultCha/uuid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thibaultCha/uuid/downloads","issues_url":"https://api.github.com/repos/thibaultCha/uuid/issues{/number}","pulls_url":"https://api.github.com/repos/thibaultCha/uuid/pulls{/number}","milestones_url":"https://api.github.com/repos/thibaultCha/uuid/milestones{/number}","notifications_url":"https://api.github.com/repos/thibaultCha/uuid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thibaultCha/uuid/labels{/name}","releases_url":"https://api.github.com/repos/thibaultCha/uuid/releases{/id}","deployments_url":"https://api.github.com/repos/thibaultCha/uuid/deployments","created_at":"2016-03-22T07:18:21Z","updated_at":"2016-03-22T07:18:22Z","pushed_at":"2016-03-22T07:28:55Z","git_url":"git://github.com/thibaultCha/uuid.git","ssh_url":"git@github.com:thibaultCha/uuid.git","clone_url":"https://github.com/thibaultCha/uuid.git","svn_url":"https://github.com/thibaultCha/uuid","homepage":"http://tieske.github.io/uuid/","size":28,"stargazers_count":0,"watchers_count":0,"language":"Lua","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":"Tieske:master","ref":"master","sha":"75f84281f4c45838f59fc2c6f893fa20e32389b6","user":{"login":"Tieske","id":1077043,"avatar_url":"https://avatars.githubusercontent.com/u/1077043?v=3","gravatar_id":"","url":"https://api.github.com/users/Tieske","html_url":"https://github.com/Tieske","followers_url":"https://api.github.com/users/Tieske/followers","following_url":"https://api.github.com/users/Tieske/following{/other_user}","gists_url":"https://api.github.com/users/Tieske/gists{/gist_id}","starred_url":"https://api.github.com/users/Tieske/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tieske/subscriptions","organizations_url":"https://api.github.com/users/Tieske/orgs","repos_url":"https://api.github.com/users/Tieske/repos","events_url":"https://api.github.com/users/Tieske/events{/privacy}","received_events_url":"https://api.github.com/users/Tieske/received_events","type":"User","site_admin":false},"repo":{"id":9729349,"name":"uuid","full_name":"Tieske/uuid","owner":{"login":"Tieske","id":1077043,"avatar_url":"https://avatars.githubusercontent.com/u/1077043?v=3","gravatar_id":"","url":"https://api.github.com/users/Tieske","html_url":"https://github.com/Tieske","followers_url":"https://api.github.com/users/Tieske/followers","following_url":"https://api.github.com/users/Tieske/following{/other_user}","gists_url":"https://api.github.com/users/Tieske/gists{/gist_id}","starred_url":"https://api.github.com/users/Tieske/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tieske/subscriptions","organizations_url":"https://api.github.com/users/Tieske/orgs","repos_url":"https://api.github.com/users/Tieske/repos","events_url":"https://api.github.com/users/Tieske/events{/privacy}","received_events_url":"https://api.github.com/users/Tieske/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Tieske/uuid","description":"A pure Lua uuid generator (modified from a Rackspace module)","fork":false,"url":"https://api.github.com/repos/Tieske/uuid","forks_url":"https://api.github.com/repos/Tieske/uuid/forks","keys_url":"https://api.github.com/repos/Tieske/uuid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tieske/uuid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tieske/uuid/teams","hooks_url":"https://api.github.com/repos/Tieske/uuid/hooks","issue_events_url":"https://api.github.com/repos/Tieske/uuid/issues/events{/number}","events_url":"https://api.github.com/repos/Tieske/uuid/events","assignees_url":"https://api.github.com/repos/Tieske/uuid/assignees{/user}","branches_url":"https://api.github.com/repos/Tieske/uuid/branches{/branch}","tags_url":"https://api.github.com/repos/Tieske/uuid/tags","blobs_url":"https://api.github.com/repos/Tieske/uuid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tieske/uuid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tieske/uuid/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tieske/uuid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tieske/uuid/statuses/{sha}","languages_url":"https://api.github.com/repos/Tieske/uuid/languages","stargazers_url":"https://api.github.com/repos/Tieske/uuid/stargazers","contributors_url":"https://api.github.com/repos/Tieske/uuid/contributors","subscribers_url":"https://api.github.com/repos/Tieske/uuid/subscribers","subscription_url":"https://api.github.com/repos/Tieske/uuid/subscription","commits_url":"https://api.github.com/repos/Tieske/uuid/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tieske/uuid/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tieske/uuid/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tieske/uuid/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tieske/uuid/contents/{+path}","compare_url":"https://api.github.com/repos/Tieske/uuid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tieske/uuid/merges","archive_url":"https://api.github.com/repos/Tieske/uuid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tieske/uuid/downloads","issues_url":"https://api.github.com/repos/Tieske/uuid/issues{/number}","pulls_url":"https://api.github.com/repos/Tieske/uuid/pulls{/number}","milestones_url":"https://api.github.com/repos/Tieske/uuid/milestones{/number}","notifications_url":"https://api.github.com/repos/Tieske/uuid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tieske/uuid/labels{/name}","releases_url":"https://api.github.com/repos/Tieske/uuid/releases{/id}","deployments_url":"https://api.github.com/repos/Tieske/uuid/deployments","created_at":"2013-04-28T11:42:46Z","updated_at":"2016-03-14T12:58:43Z","pushed_at":"2016-03-02T13:21:36Z","git_url":"git://github.com/Tieske/uuid.git","ssh_url":"git@github.com:Tieske/uuid.git","clone_url":"https://github.com/Tieske/uuid.git","svn_url":"https://github.com/Tieske/uuid","homepage":"http://tieske.github.io/uuid/","size":138,"stargazers_count":44,"watchers_count":44,"language":"Lua","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"open_issues_count":3,"forks":10,"open_issues":3,"watchers":44,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Tieske/uuid/pulls/8"},"html":{"href":"https://github.com/Tieske/uuid/pull/8"},"issue":{"href":"https://api.github.com/repos/Tieske/uuid/issues/8"},"comments":{"href":"https://api.github.com/repos/Tieske/uuid/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/Tieske/uuid/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/Tieske/uuid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Tieske/uuid/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/Tieske/uuid/statuses/40e93312d272e08b3d9723e720273b609ab7ad05"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":8,"deletions":4,"changed_files":1}}