{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/remoting/pulls/comments/24900884","id":24900884,"diff_hunk":"@@ -1006,9 +1012,14 @@ public void checkRoles(RoleChecker checker) throws SecurityException {\n      * @since 1.299\n      */\n     public synchronized void join(long timeout) throws InterruptedException {\n-        long start = System.currentTimeMillis();\n-        while(System.currentTimeMillis()-start<timeout && (inClosed==null || outClosed==null))\n-            wait(timeout+start-System.currentTimeMillis());\n+        long now = System.currentTimeMillis();\n+        long end = now + timeout;\n+        while (now < end && (inClosed == null || outClosed == null)) {\n+            wait(now - end);","path":"src/main/java/hudson/remoting/Channel.java","position":51,"original_position":51,"commit_id":"29ec965650bba57145df14f0fee73acbd8ce5248","original_commit_id":"29ec965650bba57145df14f0fee73acbd8ce5248","user":{"login":"jtnord","id":494726,"avatar_url":"https://avatars.githubusercontent.com/u/494726?v=3","gravatar_id":"","url":"https://api.github.com/users/jtnord","html_url":"https://github.com/jtnord","followers_url":"https://api.github.com/users/jtnord/followers","following_url":"https://api.github.com/users/jtnord/following{/other_user}","gists_url":"https://api.github.com/users/jtnord/gists{/gist_id}","starred_url":"https://api.github.com/users/jtnord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtnord/subscriptions","organizations_url":"https://api.github.com/users/jtnord/orgs","repos_url":"https://api.github.com/users/jtnord/repos","events_url":"https://api.github.com/users/jtnord/events{/privacy}","received_events_url":"https://api.github.com/users/jtnord/received_events","type":"User","site_admin":false},"body":"same as currently happens - instead of waiting for 4 minutes you will wait longer.\r\n\r\nThis will never be a negative or zero wait due to the \"now < end\" condition (once I fix the bug).\r\n\r\nWhat will be prevented though is that you will at least wait once (unless inClosed or OutClouse !- null) - whereas before you where never guaranteed to wait.","created_at":"2015-02-18T13:40:59Z","updated_at":"2015-02-18T13:40:59Z","html_url":"https://github.com/jenkinsci/remoting/pull/29#discussion_r24900884","pull_request_url":"https://api.github.com/repos/jenkinsci/remoting/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/remoting/pulls/comments/24900884"},"html":{"href":"https://github.com/jenkinsci/remoting/pull/29#discussion_r24900884"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/remoting/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/remoting/pulls/29","id":29524536,"html_url":"https://github.com/jenkinsci/remoting/pull/29","diff_url":"https://github.com/jenkinsci/remoting/pull/29.diff","patch_url":"https://github.com/jenkinsci/remoting/pull/29.patch","issue_url":"https://api.github.com/repos/jenkinsci/remoting/issues/29","number":29,"state":"open","locked":false,"title":"Jenkins 21251","user":{"login":"jtnord","id":494726,"avatar_url":"https://avatars.githubusercontent.com/u/494726?v=3","gravatar_id":"","url":"https://api.github.com/users/jtnord","html_url":"https://github.com/jtnord","followers_url":"https://api.github.com/users/jtnord/followers","following_url":"https://api.github.com/users/jtnord/following{/other_user}","gists_url":"https://api.github.com/users/jtnord/gists{/gist_id}","starred_url":"https://api.github.com/users/jtnord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtnord/subscriptions","organizations_url":"https://api.github.com/users/jtnord/orgs","repos_url":"https://api.github.com/users/jtnord/repos","events_url":"https://api.github.com/users/jtnord/events{/privacy}","received_events_url":"https://api.github.com/users/jtnord/received_events","type":"User","site_admin":false},"body":"Initial calculation of duration to wait is susceptible to the clock changing (e.g. NTP).\r\n\r\nChanged the code so that the initial calculation is performed with a single call to System.currentTimeMillis().\r\nAt this point I do not believe the overhead of using System.nanoTime() is worth the overhead.\r\n\r\n@reviewbybees\r\n","created_at":"2015-02-18T13:23:25Z","updated_at":"2015-02-18T13:40:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eacc373f43fa70c3a4815a7b9f46ce40a7654bab","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/remoting/pulls/29/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/remoting/pulls/29/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/remoting/pulls/comments/{number}","comments_url":"https://api.github.com/repos/jenkinsci/remoting/issues/29/comments","statuses_url":"https://api.github.com/repos/jenkinsci/remoting/statuses/29ec965650bba57145df14f0fee73acbd8ce5248","head":{"label":"jenkinsci:JENKINS-21251","ref":"JENKINS-21251","sha":"29ec965650bba57145df14f0fee73acbd8ce5248","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":2040168,"name":"remoting","full_name":"jenkinsci/remoting","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/remoting","description":"Jenkins remoting module","fork":false,"url":"https://api.github.com/repos/jenkinsci/remoting","forks_url":"https://api.github.com/repos/jenkinsci/remoting/forks","keys_url":"https://api.github.com/repos/jenkinsci/remoting/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/remoting/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/remoting/teams","hooks_url":"https://api.github.com/repos/jenkinsci/remoting/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/remoting/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/remoting/events","assignees_url":"https://api.github.com/repos/jenkinsci/remoting/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/remoting/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/remoting/tags","blobs_url":"https://api.github.com/repos/jenkinsci/remoting/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/remoting/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/remoting/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/remoting/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/remoting/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/remoting/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/remoting/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/remoting/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/remoting/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/remoting/subscription","commits_url":"https://api.github.com/repos/jenkinsci/remoting/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/remoting/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/remoting/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/remoting/issues/comments/{number}","contents_url":"https://api.github.com/repos/jenkinsci/remoting/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/remoting/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/remoting/merges","archive_url":"https://api.github.com/repos/jenkinsci/remoting/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/remoting/downloads","issues_url":"https://api.github.com/repos/jenkinsci/remoting/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/remoting/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/remoting/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/remoting/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/remoting/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/remoting/releases{/id}","created_at":"2011-07-13T05:06:16Z","updated_at":"2015-02-17T12:52:19Z","pushed_at":"2015-02-18T13:19:50Z","git_url":"git://github.com/jenkinsci/remoting.git","ssh_url":"git@github.com:jenkinsci/remoting.git","clone_url":"https://github.com/jenkinsci/remoting.git","svn_url":"https://github.com/jenkinsci/remoting","homepage":"http://jenkins-ci.org/","size":3067,"stargazers_count":26,"watchers_count":26,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":43,"mirror_url":null,"open_issues_count":5,"forks":43,"open_issues":5,"watchers":26,"default_branch":"master"}},"base":{"label":"jenkinsci:master","ref":"master","sha":"e62cef4143e81741a243697b463f3434bc6deb68","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":2040168,"name":"remoting","full_name":"jenkinsci/remoting","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/remoting","description":"Jenkins remoting module","fork":false,"url":"https://api.github.com/repos/jenkinsci/remoting","forks_url":"https://api.github.com/repos/jenkinsci/remoting/forks","keys_url":"https://api.github.com/repos/jenkinsci/remoting/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/remoting/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/remoting/teams","hooks_url":"https://api.github.com/repos/jenkinsci/remoting/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/remoting/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/remoting/events","assignees_url":"https://api.github.com/repos/jenkinsci/remoting/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/remoting/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/remoting/tags","blobs_url":"https://api.github.com/repos/jenkinsci/remoting/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/remoting/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/remoting/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/remoting/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/remoting/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/remoting/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/remoting/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/remoting/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/remoting/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/remoting/subscription","commits_url":"https://api.github.com/repos/jenkinsci/remoting/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/remoting/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/remoting/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/remoting/issues/comments/{number}","contents_url":"https://api.github.com/repos/jenkinsci/remoting/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/remoting/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/remoting/merges","archive_url":"https://api.github.com/repos/jenkinsci/remoting/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/remoting/downloads","issues_url":"https://api.github.com/repos/jenkinsci/remoting/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/remoting/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/remoting/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/remoting/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/remoting/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/remoting/releases{/id}","created_at":"2011-07-13T05:06:16Z","updated_at":"2015-02-17T12:52:19Z","pushed_at":"2015-02-18T13:19:50Z","git_url":"git://github.com/jenkinsci/remoting.git","ssh_url":"git@github.com:jenkinsci/remoting.git","clone_url":"https://github.com/jenkinsci/remoting.git","svn_url":"https://github.com/jenkinsci/remoting","homepage":"http://jenkins-ci.org/","size":3067,"stargazers_count":26,"watchers_count":26,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":43,"mirror_url":null,"open_issues_count":5,"forks":43,"open_issues":5,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/remoting/pulls/29"},"html":{"href":"https://github.com/jenkinsci/remoting/pull/29"},"issue":{"href":"https://api.github.com/repos/jenkinsci/remoting/issues/29"},"comments":{"href":"https://api.github.com/repos/jenkinsci/remoting/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/remoting/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/remoting/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/remoting/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/remoting/statuses/29ec965650bba57145df14f0fee73acbd8ce5248"}}}}