{"action":"created","comment":{"url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/comments/124425928","pull_request_review_id":46712796,"id":124425928,"diff_hunk":"@@ -259,13 +260,29 @@ static void get_pid_metrics(apr_int32_t pid, apr_int32_t tmid, apr_int32_t ssid,\n \tif (rec && rec->updated_tick == gx.tick)\n \t\treturn; /* updated in current cycle */\n \n-\tTR2((\"--------------------- stating %d\\n\", pid));\n \tmemset(&cpu, 0, sizeof(cpu));\n \tmemset(&mem, 0, sizeof(mem));\n \tmemset(&fd, 0, sizeof(fd));\n-\tsigar_proc_mem_get(gx.sigar, pid, &mem);\n-\tsigar_proc_cpu_get(gx.sigar, pid, &cpu);\n-\tsigar_proc_fd_get(gx.sigar, pid, &fd);\n+\n+\tstatus = sigar_proc_mem_get(gx.sigar, pid, &mem);\n+\tif (status != SIGAR_OK) {\n+\t\tTR0((\"[WARNING] %s. PID: %d\\n\", strerror(status), pid));","path":"gpAux/gpperfmon/src/gpmon/gpsmon.c","position":22,"original_position":22,"commit_id":"b932196b4b6de92bbf0417335c2f7be55595a0ee","original_commit_id":"b932196b4b6de92bbf0417335c2f7be55595a0ee","user":{"login":"larham","id":467739,"avatar_url":"https://avatars0.githubusercontent.com/u/467739?v=3","gravatar_id":"","url":"https://api.github.com/users/larham","html_url":"https://github.com/larham","followers_url":"https://api.github.com/users/larham/followers","following_url":"https://api.github.com/users/larham/following{/other_user}","gists_url":"https://api.github.com/users/larham/gists{/gist_id}","starred_url":"https://api.github.com/users/larham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larham/subscriptions","organizations_url":"https://api.github.com/users/larham/orgs","repos_url":"https://api.github.com/users/larham/repos","events_url":"https://api.github.com/users/larham/events{/privacy}","received_events_url":"https://api.github.com/users/larham/received_events","type":"User","site_admin":false},"body":"I'm wondering about printing a warning here.  If the situation is expected/normal, like a query that is finished but not \"dumped\" yet (so no process exists), then it doesn't feel like a warning.  Perhaps conditionalize the cases when the result of sigar is truly unexpected? ","created_at":"2017-06-28T00:02:19Z","updated_at":"2017-06-28T00:02:19Z","html_url":"https://github.com/greenplum-db/gpdb/pull/2702#discussion_r124425928","pull_request_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/2702","_links":{"self":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/comments/124425928"},"html":{"href":"https://github.com/greenplum-db/gpdb/pull/2702#discussion_r124425928"},"pull_request":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/2702"}}},"pull_request":{"url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/2702","id":127583328,"html_url":"https://github.com/greenplum-db/gpdb/pull/2702","diff_url":"https://github.com/greenplum-db/gpdb/pull/2702.diff","patch_url":"https://github.com/greenplum-db/gpdb/pull/2702.patch","issue_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/2702","number":2702,"state":"open","locked":false,"title":"gpperfmon: Fix incorrect data saved into queries_history table","user":{"login":"Chibin","id":1973117,"avatar_url":"https://avatars1.githubusercontent.com/u/1973117?v=3","gravatar_id":"","url":"https://api.github.com/users/Chibin","html_url":"https://github.com/Chibin","followers_url":"https://api.github.com/users/Chibin/followers","following_url":"https://api.github.com/users/Chibin/following{/other_user}","gists_url":"https://api.github.com/users/Chibin/gists{/gist_id}","starred_url":"https://api.github.com/users/Chibin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chibin/subscriptions","organizations_url":"https://api.github.com/users/Chibin/orgs","repos_url":"https://api.github.com/users/Chibin/repos","events_url":"https://api.github.com/users/Chibin/events{/privacy}","received_events_url":"https://api.github.com/users/Chibin/received_events","type":"User","site_admin":false},"body":"    sigar_proc_cpu_get is the function which takes a pid\r\n    and goes to the cpu and gets the cpu_elapsed value for that pid at a\r\n    given moment.\r\n\r\n    get_pid_metrics saves the information into a hash table within the\r\n    gpsmon process. That pid only gets wiped out of the hashtable when\r\n    gpmmon requests a dump command to gpsmon.\r\n\r\n    gpsmon process sends tcp packets with information about cpu_elapsed\r\n    (amount of cpu cycles spent on a given\r\n    slice/process). Doing a 'dump' clears out the gpsmon hashtables.\r\n\r\n    This could lead to scenarios where a query has ended,\r\n    the process has died, and the sigar_proc_cpu_get function can't find the pid\r\n    so it puts 0 into the struct which is updating the hashtable so the\r\n    hashtable has a 0 for cpu_elapsed and then this is what is in\r\n    queries_tail and so queries_history ends up having a 0 for cpu_elapsed\r\n    since it was the last entry in queries_tail\r\n\r\n    Fix: Ensure that we validate the functions that request pid metrics\r\n    from libsigar and log the issues if they occur.","created_at":"2017-06-26T23:18:49Z","updated_at":"2017-06-28T00:02:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7b6740fb3e2b14b0d99fe23797f1159f10397926","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/2702/commits","review_comments_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/2702/comments","review_comment_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/2702/comments","statuses_url":"https://api.github.com/repos/greenplum-db/gpdb/statuses/b932196b4b6de92bbf0417335c2f7be55595a0ee","head":{"label":"Chibin:gpperfmon_fix_timing","ref":"gpperfmon_fix_timing","sha":"b932196b4b6de92bbf0417335c2f7be55595a0ee","user":{"login":"Chibin","id":1973117,"avatar_url":"https://avatars1.githubusercontent.com/u/1973117?v=3","gravatar_id":"","url":"https://api.github.com/users/Chibin","html_url":"https://github.com/Chibin","followers_url":"https://api.github.com/users/Chibin/followers","following_url":"https://api.github.com/users/Chibin/following{/other_user}","gists_url":"https://api.github.com/users/Chibin/gists{/gist_id}","starred_url":"https://api.github.com/users/Chibin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chibin/subscriptions","organizations_url":"https://api.github.com/users/Chibin/orgs","repos_url":"https://api.github.com/users/Chibin/repos","events_url":"https://api.github.com/users/Chibin/events{/privacy}","received_events_url":"https://api.github.com/users/Chibin/received_events","type":"User","site_admin":false},"repo":{"id":45487529,"name":"gpdb","full_name":"Chibin/gpdb","owner":{"login":"Chibin","id":1973117,"avatar_url":"https://avatars1.githubusercontent.com/u/1973117?v=3","gravatar_id":"","url":"https://api.github.com/users/Chibin","html_url":"https://github.com/Chibin","followers_url":"https://api.github.com/users/Chibin/followers","following_url":"https://api.github.com/users/Chibin/following{/other_user}","gists_url":"https://api.github.com/users/Chibin/gists{/gist_id}","starred_url":"https://api.github.com/users/Chibin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chibin/subscriptions","organizations_url":"https://api.github.com/users/Chibin/orgs","repos_url":"https://api.github.com/users/Chibin/repos","events_url":"https://api.github.com/users/Chibin/events{/privacy}","received_events_url":"https://api.github.com/users/Chibin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Chibin/gpdb","description":"Pivotal Greenplum Database","fork":true,"url":"https://api.github.com/repos/Chibin/gpdb","forks_url":"https://api.github.com/repos/Chibin/gpdb/forks","keys_url":"https://api.github.com/repos/Chibin/gpdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Chibin/gpdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Chibin/gpdb/teams","hooks_url":"https://api.github.com/repos/Chibin/gpdb/hooks","issue_events_url":"https://api.github.com/repos/Chibin/gpdb/issues/events{/number}","events_url":"https://api.github.com/repos/Chibin/gpdb/events","assignees_url":"https://api.github.com/repos/Chibin/gpdb/assignees{/user}","branches_url":"https://api.github.com/repos/Chibin/gpdb/branches{/branch}","tags_url":"https://api.github.com/repos/Chibin/gpdb/tags","blobs_url":"https://api.github.com/repos/Chibin/gpdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Chibin/gpdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Chibin/gpdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/Chibin/gpdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Chibin/gpdb/statuses/{sha}","languages_url":"https://api.github.com/repos/Chibin/gpdb/languages","stargazers_url":"https://api.github.com/repos/Chibin/gpdb/stargazers","contributors_url":"https://api.github.com/repos/Chibin/gpdb/contributors","subscribers_url":"https://api.github.com/repos/Chibin/gpdb/subscribers","subscription_url":"https://api.github.com/repos/Chibin/gpdb/subscription","commits_url":"https://api.github.com/repos/Chibin/gpdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/Chibin/gpdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/Chibin/gpdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/Chibin/gpdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/Chibin/gpdb/contents/{+path}","compare_url":"https://api.github.com/repos/Chibin/gpdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Chibin/gpdb/merges","archive_url":"https://api.github.com/repos/Chibin/gpdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Chibin/gpdb/downloads","issues_url":"https://api.github.com/repos/Chibin/gpdb/issues{/number}","pulls_url":"https://api.github.com/repos/Chibin/gpdb/pulls{/number}","milestones_url":"https://api.github.com/repos/Chibin/gpdb/milestones{/number}","notifications_url":"https://api.github.com/repos/Chibin/gpdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Chibin/gpdb/labels{/name}","releases_url":"https://api.github.com/repos/Chibin/gpdb/releases{/id}","deployments_url":"https://api.github.com/repos/Chibin/gpdb/deployments","created_at":"2015-11-03T18:38:29Z","updated_at":"2017-03-29T16:46:55Z","pushed_at":"2017-06-27T23:38:56Z","git_url":"git://github.com/Chibin/gpdb.git","ssh_url":"git@github.com:Chibin/gpdb.git","clone_url":"https://github.com/Chibin/gpdb.git","svn_url":"https://github.com/Chibin/gpdb","homepage":"http://greenplum.org","size":431770,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"greenplum-db:master","ref":"master","sha":"464ecf3766d9977d175d3904dbb51d2a3950c7e2","user":{"login":"greenplum-db","id":14097842,"avatar_url":"https://avatars1.githubusercontent.com/u/14097842?v=3","gravatar_id":"","url":"https://api.github.com/users/greenplum-db","html_url":"https://github.com/greenplum-db","followers_url":"https://api.github.com/users/greenplum-db/followers","following_url":"https://api.github.com/users/greenplum-db/following{/other_user}","gists_url":"https://api.github.com/users/greenplum-db/gists{/gist_id}","starred_url":"https://api.github.com/users/greenplum-db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenplum-db/subscriptions","organizations_url":"https://api.github.com/users/greenplum-db/orgs","repos_url":"https://api.github.com/users/greenplum-db/repos","events_url":"https://api.github.com/users/greenplum-db/events{/privacy}","received_events_url":"https://api.github.com/users/greenplum-db/received_events","type":"Organization","site_admin":false},"repo":{"id":44781140,"name":"gpdb","full_name":"greenplum-db/gpdb","owner":{"login":"greenplum-db","id":14097842,"avatar_url":"https://avatars1.githubusercontent.com/u/14097842?v=3","gravatar_id":"","url":"https://api.github.com/users/greenplum-db","html_url":"https://github.com/greenplum-db","followers_url":"https://api.github.com/users/greenplum-db/followers","following_url":"https://api.github.com/users/greenplum-db/following{/other_user}","gists_url":"https://api.github.com/users/greenplum-db/gists{/gist_id}","starred_url":"https://api.github.com/users/greenplum-db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenplum-db/subscriptions","organizations_url":"https://api.github.com/users/greenplum-db/orgs","repos_url":"https://api.github.com/users/greenplum-db/repos","events_url":"https://api.github.com/users/greenplum-db/events{/privacy}","received_events_url":"https://api.github.com/users/greenplum-db/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/greenplum-db/gpdb","description":"Greenplum Database","fork":false,"url":"https://api.github.com/repos/greenplum-db/gpdb","forks_url":"https://api.github.com/repos/greenplum-db/gpdb/forks","keys_url":"https://api.github.com/repos/greenplum-db/gpdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/greenplum-db/gpdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/greenplum-db/gpdb/teams","hooks_url":"https://api.github.com/repos/greenplum-db/gpdb/hooks","issue_events_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/events{/number}","events_url":"https://api.github.com/repos/greenplum-db/gpdb/events","assignees_url":"https://api.github.com/repos/greenplum-db/gpdb/assignees{/user}","branches_url":"https://api.github.com/repos/greenplum-db/gpdb/branches{/branch}","tags_url":"https://api.github.com/repos/greenplum-db/gpdb/tags","blobs_url":"https://api.github.com/repos/greenplum-db/gpdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/greenplum-db/gpdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/greenplum-db/gpdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/greenplum-db/gpdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/greenplum-db/gpdb/statuses/{sha}","languages_url":"https://api.github.com/repos/greenplum-db/gpdb/languages","stargazers_url":"https://api.github.com/repos/greenplum-db/gpdb/stargazers","contributors_url":"https://api.github.com/repos/greenplum-db/gpdb/contributors","subscribers_url":"https://api.github.com/repos/greenplum-db/gpdb/subscribers","subscription_url":"https://api.github.com/repos/greenplum-db/gpdb/subscription","commits_url":"https://api.github.com/repos/greenplum-db/gpdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/greenplum-db/gpdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/greenplum-db/gpdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/greenplum-db/gpdb/contents/{+path}","compare_url":"https://api.github.com/repos/greenplum-db/gpdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/greenplum-db/gpdb/merges","archive_url":"https://api.github.com/repos/greenplum-db/gpdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/greenplum-db/gpdb/downloads","issues_url":"https://api.github.com/repos/greenplum-db/gpdb/issues{/number}","pulls_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls{/number}","milestones_url":"https://api.github.com/repos/greenplum-db/gpdb/milestones{/number}","notifications_url":"https://api.github.com/repos/greenplum-db/gpdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/greenplum-db/gpdb/labels{/name}","releases_url":"https://api.github.com/repos/greenplum-db/gpdb/releases{/id}","deployments_url":"https://api.github.com/repos/greenplum-db/gpdb/deployments","created_at":"2015-10-23T00:25:17Z","updated_at":"2017-06-27T15:15:55Z","pushed_at":"2017-06-27T23:54:49Z","git_url":"git://github.com/greenplum-db/gpdb.git","ssh_url":"git@github.com:greenplum-db/gpdb.git","clone_url":"https://github.com/greenplum-db/gpdb.git","svn_url":"https://github.com/greenplum-db/gpdb","homepage":"http://greenplum.org","size":213984,"stargazers_count":1988,"watchers_count":1988,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":614,"mirror_url":null,"open_issues_count":136,"forks":614,"open_issues":136,"watchers":1988,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/2702"},"html":{"href":"https://github.com/greenplum-db/gpdb/pull/2702"},"issue":{"href":"https://api.github.com/repos/greenplum-db/gpdb/issues/2702"},"comments":{"href":"https://api.github.com/repos/greenplum-db/gpdb/issues/2702/comments"},"review_comments":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/2702/comments"},"review_comment":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/2702/commits"},"statuses":{"href":"https://api.github.com/repos/greenplum-db/gpdb/statuses/b932196b4b6de92bbf0417335c2f7be55595a0ee"}}}}
{"actor":{"display_login":"larham"}}