{"action":"closed","number":3248,"pull_request":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/3248","id":59904329,"html_url":"https://github.com/dotnet/coreclr/pull/3248","diff_url":"https://github.com/dotnet/coreclr/pull/3248.diff","patch_url":"https://github.com/dotnet/coreclr/pull/3248.patch","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/3248","number":3248,"state":"closed","locked":false,"title":"Disambiguate debug pipe names with more than just PID","user":{"login":"adityamandaleeka","id":219224,"avatar_url":"https://avatars.githubusercontent.com/u/219224?v=3","gravatar_id":"","url":"https://api.github.com/users/adityamandaleeka","html_url":"https://github.com/adityamandaleeka","followers_url":"https://api.github.com/users/adityamandaleeka/followers","following_url":"https://api.github.com/users/adityamandaleeka/following{/other_user}","gists_url":"https://api.github.com/users/adityamandaleeka/gists{/gist_id}","starred_url":"https://api.github.com/users/adityamandaleeka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adityamandaleeka/subscriptions","organizations_url":"https://api.github.com/users/adityamandaleeka/orgs","repos_url":"https://api.github.com/users/adityamandaleeka/repos","events_url":"https://api.github.com/users/adityamandaleeka/events{/privacy}","received_events_url":"https://api.github.com/users/adityamandaleeka/received_events","type":"User","site_admin":false},"body":"This change fixes an issue that occurs in situations where the pipes used by the debugging code aren't cleaned up (for example, if the process was killed forcefully). When this happens, the next time a process with the same PID starts, managed debuggers will fail to attach to it because there is garbage left over from the previous process. This scenario sounds implausible, but it is very common when running on Docker since the main process always gets the same PID (1) and the /tmp directory isn't cleared when a container is killed and restarted.\r\n\r\nTo get around this, we needed to add something to the pipe name that could: \r\n- (a) be used to distinguish between processes with the same PID\r\n- (b) be derived by the process itself and also by any other process that wants to debug it.\r\n\r\nThis change adds a function to PAL that can be called to get a unique numeric value that can be used for this purpose. The value is based on the start time of the process, so it satisfies (a), but it means something different on different platforms. On OS X, it is expressed in seconds since the Unix epoch, and on platforms with the proc filesystem, it's expressed in jiffies since boot. Because the only purpose of this function is to distinguish between processes with the same PID, these differences are not problematic. Further, any type of time conversion to unify them risks compromising (b) due to off-by-one or rounding errors that could be introduced.\r\n\r\nPlease do not merge this yet, as I haven't completed testing it.\r\n\r\nWe'll need to do the same for semaphores. If this PR is ready to merge before I get to it, I'll open a new one for that change. Otherwise, I'll update this one.\r\n\r\n@mikem8361 ","created_at":"2016-02-19T04:49:23Z","updated_at":"2016-02-23T02:03:20Z","closed_at":"2016-02-23T02:03:20Z","merged_at":"2016-02-23T02:03:20Z","merge_commit_sha":"22edecfb45878e641cb6c59f0284e4ae2aee3313","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/coreclr/pulls/3248/commits","review_comments_url":"https://api.github.com/repos/dotnet/coreclr/pulls/3248/comments","review_comment_url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/3248/comments","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/798009b0af35ca95e65888ed706d1fe5f0c229cb","head":{"label":"adityamandaleeka:twowaypipe_cleanup","ref":"twowaypipe_cleanup","sha":"798009b0af35ca95e65888ed706d1fe5f0c229cb","user":{"login":"adityamandaleeka","id":219224,"avatar_url":"https://avatars.githubusercontent.com/u/219224?v=3","gravatar_id":"","url":"https://api.github.com/users/adityamandaleeka","html_url":"https://github.com/adityamandaleeka","followers_url":"https://api.github.com/users/adityamandaleeka/followers","following_url":"https://api.github.com/users/adityamandaleeka/following{/other_user}","gists_url":"https://api.github.com/users/adityamandaleeka/gists{/gist_id}","starred_url":"https://api.github.com/users/adityamandaleeka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adityamandaleeka/subscriptions","organizations_url":"https://api.github.com/users/adityamandaleeka/orgs","repos_url":"https://api.github.com/users/adityamandaleeka/repos","events_url":"https://api.github.com/users/adityamandaleeka/events{/privacy}","received_events_url":"https://api.github.com/users/adityamandaleeka/received_events","type":"User","site_admin":false},"repo":{"id":34361179,"name":"coreclr","full_name":"adityamandaleeka/coreclr","owner":{"login":"adityamandaleeka","id":219224,"avatar_url":"https://avatars.githubusercontent.com/u/219224?v=3","gravatar_id":"","url":"https://api.github.com/users/adityamandaleeka","html_url":"https://github.com/adityamandaleeka","followers_url":"https://api.github.com/users/adityamandaleeka/followers","following_url":"https://api.github.com/users/adityamandaleeka/following{/other_user}","gists_url":"https://api.github.com/users/adityamandaleeka/gists{/gist_id}","starred_url":"https://api.github.com/users/adityamandaleeka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adityamandaleeka/subscriptions","organizations_url":"https://api.github.com/users/adityamandaleeka/orgs","repos_url":"https://api.github.com/users/adityamandaleeka/repos","events_url":"https://api.github.com/users/adityamandaleeka/events{/privacy}","received_events_url":"https://api.github.com/users/adityamandaleeka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adityamandaleeka/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR, and the base library, called mscorlib. It includes the garbage collector, JIT compiler, base .NET data types and many low-level classes.","fork":true,"url":"https://api.github.com/repos/adityamandaleeka/coreclr","forks_url":"https://api.github.com/repos/adityamandaleeka/coreclr/forks","keys_url":"https://api.github.com/repos/adityamandaleeka/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adityamandaleeka/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adityamandaleeka/coreclr/teams","hooks_url":"https://api.github.com/repos/adityamandaleeka/coreclr/hooks","issue_events_url":"https://api.github.com/repos/adityamandaleeka/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/adityamandaleeka/coreclr/events","assignees_url":"https://api.github.com/repos/adityamandaleeka/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/adityamandaleeka/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/adityamandaleeka/coreclr/tags","blobs_url":"https://api.github.com/repos/adityamandaleeka/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adityamandaleeka/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adityamandaleeka/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/adityamandaleeka/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adityamandaleeka/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/adityamandaleeka/coreclr/languages","stargazers_url":"https://api.github.com/repos/adityamandaleeka/coreclr/stargazers","contributors_url":"https://api.github.com/repos/adityamandaleeka/coreclr/contributors","subscribers_url":"https://api.github.com/repos/adityamandaleeka/coreclr/subscribers","subscription_url":"https://api.github.com/repos/adityamandaleeka/coreclr/subscription","commits_url":"https://api.github.com/repos/adityamandaleeka/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/adityamandaleeka/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/adityamandaleeka/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/adityamandaleeka/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/adityamandaleeka/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/adityamandaleeka/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adityamandaleeka/coreclr/merges","archive_url":"https://api.github.com/repos/adityamandaleeka/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adityamandaleeka/coreclr/downloads","issues_url":"https://api.github.com/repos/adityamandaleeka/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/adityamandaleeka/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/adityamandaleeka/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/adityamandaleeka/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adityamandaleeka/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/adityamandaleeka/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/adityamandaleeka/coreclr/deployments","created_at":"2015-04-22T01:19:44Z","updated_at":"2016-01-11T23:07:00Z","pushed_at":"2016-02-22T22:59:21Z","git_url":"git://github.com/adityamandaleeka/coreclr.git","ssh_url":"git@github.com:adityamandaleeka/coreclr.git","clone_url":"https://github.com/adityamandaleeka/coreclr.git","svn_url":"https://github.com/adityamandaleeka/coreclr","homepage":"","size":59671,"stargazers_count":0,"watchers_count":0,"language":"C#","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":"dotnet:master","ref":"master","sha":"a60523e59973b07f7240f3970a4fa41e14c9d6a6","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":30092893,"name":"coreclr","full_name":"dotnet/coreclr","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR, and the base library, called mscorlib. It includes the garbage collector, JIT compiler, base .NET data types and many low-level classes.","fork":false,"url":"https://api.github.com/repos/dotnet/coreclr","forks_url":"https://api.github.com/repos/dotnet/coreclr/forks","keys_url":"https://api.github.com/repos/dotnet/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/coreclr/teams","hooks_url":"https://api.github.com/repos/dotnet/coreclr/hooks","issue_events_url":"https://api.github.com/repos/dotnet/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/coreclr/events","assignees_url":"https://api.github.com/repos/dotnet/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/coreclr/tags","blobs_url":"https://api.github.com/repos/dotnet/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/coreclr/languages","stargazers_url":"https://api.github.com/repos/dotnet/coreclr/stargazers","contributors_url":"https://api.github.com/repos/dotnet/coreclr/contributors","subscribers_url":"https://api.github.com/repos/dotnet/coreclr/subscribers","subscription_url":"https://api.github.com/repos/dotnet/coreclr/subscription","commits_url":"https://api.github.com/repos/dotnet/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/coreclr/merges","archive_url":"https://api.github.com/repos/dotnet/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/coreclr/downloads","issues_url":"https://api.github.com/repos/dotnet/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/coreclr/deployments","created_at":"2015-01-30T22:10:02Z","updated_at":"2016-02-23T01:32:43Z","pushed_at":"2016-02-23T02:03:20Z","git_url":"git://github.com/dotnet/coreclr.git","ssh_url":"git@github.com:dotnet/coreclr.git","clone_url":"https://github.com/dotnet/coreclr.git","svn_url":"https://github.com/dotnet/coreclr","homepage":"http://dotnet.github.io/","size":64776,"stargazers_count":5911,"watchers_count":5911,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1304,"mirror_url":null,"open_issues_count":545,"forks":1304,"open_issues":545,"watchers":5911,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/3248"},"html":{"href":"https://github.com/dotnet/coreclr/pull/3248"},"issue":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/3248"},"comments":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/3248/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/3248/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/3248/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/coreclr/statuses/798009b0af35ca95e65888ed706d1fe5f0c229cb"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"adityamandaleeka","id":219224,"avatar_url":"https://avatars.githubusercontent.com/u/219224?v=3","gravatar_id":"","url":"https://api.github.com/users/adityamandaleeka","html_url":"https://github.com/adityamandaleeka","followers_url":"https://api.github.com/users/adityamandaleeka/followers","following_url":"https://api.github.com/users/adityamandaleeka/following{/other_user}","gists_url":"https://api.github.com/users/adityamandaleeka/gists{/gist_id}","starred_url":"https://api.github.com/users/adityamandaleeka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adityamandaleeka/subscriptions","organizations_url":"https://api.github.com/users/adityamandaleeka/orgs","repos_url":"https://api.github.com/users/adityamandaleeka/repos","events_url":"https://api.github.com/users/adityamandaleeka/events{/privacy}","received_events_url":"https://api.github.com/users/adityamandaleeka/received_events","type":"User","site_admin":false},"comments":3,"review_comments":0,"commits":2,"additions":167,"deletions":15,"changed_files":3}}