{"action":"created","issue":{"url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/issues/1338","repository_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited","labels_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/issues/1338/labels{/name}","comments_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/issues/1338/comments","events_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/issues/1338/events","html_url":"https://github.com/BitcoinUnlimited/BitcoinUnlimited/pull/1338","id":361551447,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2NDk1MTc2","number":1338,"title":"Stagger the rotation start times in ThreadMessageHandler()","user":{"login":"ptschip","id":12862928,"node_id":"MDQ6VXNlcjEyODYyOTI4","avatar_url":"https://avatars0.githubusercontent.com/u/12862928?v=4","gravatar_id":"","url":"https://api.github.com/users/ptschip","html_url":"https://github.com/ptschip","followers_url":"https://api.github.com/users/ptschip/followers","following_url":"https://api.github.com/users/ptschip/following{/other_user}","gists_url":"https://api.github.com/users/ptschip/gists{/gist_id}","starred_url":"https://api.github.com/users/ptschip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptschip/subscriptions","organizations_url":"https://api.github.com/users/ptschip/orgs","repos_url":"https://api.github.com/users/ptschip/repos","events_url":"https://api.github.com/users/ptschip/events{/privacy}","received_events_url":"https://api.github.com/users/ptschip/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-19T02:19:01Z","updated_at":"2018-09-20T19:53:41Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/pulls/1338","html_url":"https://github.com/BitcoinUnlimited/BitcoinUnlimited/pull/1338","diff_url":"https://github.com/BitcoinUnlimited/BitcoinUnlimited/pull/1338.diff","patch_url":"https://github.com/BitcoinUnlimited/BitcoinUnlimited/pull/1338.patch"},"body":"If we don't do this then all the threads will end up rotating one\r\nafter the other at each rotation interval. This ends up rotating all\r\nnodes by the number of message handler threads at each interval. By\r\nstaggering their start times we end up getting one thread doing a rotation\r\nat each interval.\r\n\r\nThe 60 second interval is now multiplied by the number of handler threads so\r\nthis way we get a smooth 1 minute between rotations, since we stagger the\r\nstart times for each thread also by 60 seconds."},"comment":{"url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/issues/comments/423311579","html_url":"https://github.com/BitcoinUnlimited/BitcoinUnlimited/pull/1338#issuecomment-423311579","issue_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/issues/1338","id":423311579,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzMxMTU3OQ==","user":{"login":"gandrewstone","id":89979,"node_id":"MDQ6VXNlcjg5OTc5","avatar_url":"https://avatars3.githubusercontent.com/u/89979?v=4","gravatar_id":"","url":"https://api.github.com/users/gandrewstone","html_url":"https://github.com/gandrewstone","followers_url":"https://api.github.com/users/gandrewstone/followers","following_url":"https://api.github.com/users/gandrewstone/following{/other_user}","gists_url":"https://api.github.com/users/gandrewstone/gists{/gist_id}","starred_url":"https://api.github.com/users/gandrewstone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gandrewstone/subscriptions","organizations_url":"https://api.github.com/users/gandrewstone/orgs","repos_url":"https://api.github.com/users/gandrewstone/repos","events_url":"https://api.github.com/users/gandrewstone/events{/privacy}","received_events_url":"https://api.github.com/users/gandrewstone/received_events","type":"User","site_admin":false},"created_at":"2018-09-20T19:53:41Z","updated_at":"2018-09-20T19:53:41Z","author_association":"COLLABORATOR","body":"The rotation code is locked by cs_vNodes so only 1 thread can run it at at time.  The way I read it, that code updates nLastRotation, so once it runs the logic won't trigger in any other threads for another nRotationPeriod seconds."}}
{"actor":{"display_login":"gandrewstone"}}