{"action":"created","issue":{"url":"https://api.github.com/repos/php/php-src/issues/2156","repository_url":"https://api.github.com/repos/php/php-src","labels_url":"https://api.github.com/repos/php/php-src/issues/2156/labels{/name}","comments_url":"https://api.github.com/repos/php/php-src/issues/2156/comments","events_url":"https://api.github.com/repos/php/php-src/issues/2156/events","html_url":"https://github.com/php/php-src/pull/2156","id":181033128,"number":2156,"title":"Fixed bug in zend_accel_error() and cleaned up kill_all_lockers()","user":{"login":"mhagstrand","id":685532,"avatar_url":"https://avatars.githubusercontent.com/u/685532?v=3","gravatar_id":"","url":"https://api.github.com/users/mhagstrand","html_url":"https://github.com/mhagstrand","followers_url":"https://api.github.com/users/mhagstrand/followers","following_url":"https://api.github.com/users/mhagstrand/following{/other_user}","gists_url":"https://api.github.com/users/mhagstrand/gists{/gist_id}","starred_url":"https://api.github.com/users/mhagstrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhagstrand/subscriptions","organizations_url":"https://api.github.com/users/mhagstrand/orgs","repos_url":"https://api.github.com/users/mhagstrand/repos","events_url":"https://api.github.com/users/mhagstrand/events{/privacy}","received_events_url":"https://api.github.com/users/mhagstrand/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-10-04T23:47:30Z","updated_at":"2016-10-11T21:34:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/php/php-src/pulls/2156","html_url":"https://github.com/php/php-src/pull/2156","diff_url":"https://github.com/php/php-src/pull/2156.diff","patch_url":"https://github.com/php/php-src/pull/2156.patch"},"body":"1. zend_accel_error was only executing clean up if log_verbosity_level is high enough to log\r\n2. Cleaned up kill_all_lockers function and fixed comments."},"comment":{"url":"https://api.github.com/repos/php/php-src/issues/comments/253053647","html_url":"https://github.com/php/php-src/pull/2156#issuecomment-253053647","issue_url":"https://api.github.com/repos/php/php-src/issues/2156","id":253053647,"user":{"login":"mhagstrand","id":685532,"avatar_url":"https://avatars.githubusercontent.com/u/685532?v=3","gravatar_id":"","url":"https://api.github.com/users/mhagstrand","html_url":"https://github.com/mhagstrand","followers_url":"https://api.github.com/users/mhagstrand/followers","following_url":"https://api.github.com/users/mhagstrand/following{/other_user}","gists_url":"https://api.github.com/users/mhagstrand/gists{/gist_id}","starred_url":"https://api.github.com/users/mhagstrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhagstrand/subscriptions","organizations_url":"https://api.github.com/users/mhagstrand/orgs","repos_url":"https://api.github.com/users/mhagstrand/repos","events_url":"https://api.github.com/users/mhagstrand/events{/privacy}","received_events_url":"https://api.github.com/users/mhagstrand/received_events","type":"User","site_admin":false},"created_at":"2016-10-11T21:34:19Z","updated_at":"2016-10-11T21:34:19Z","body":"Hi @dstogov \r\n\r\nDid you want to code in `kill_all_lockers` to look something like this?\r\n```c\r\n\tint success, tries = 10;\r\n\t/* so that other process won't try to force while we are busy cleaning up */\r\n\tZCSG(force_restart_time) = 0;\r\n\twhile (mem_usage_check->l_pid > 0) {\r\n\t\tsuccess = 0;\r\n\t\twhile (tries--) {\r\n\t\t\tzend_accel_error(ACCEL_LOG_WARNING, \"Attempting to kill locker %d\", mem_usage_check->l_pid);\r\n\t\t\tif (kill(mem_usage_check->l_pid, SIGKILL)) {\r\n\t\t\t\tif (errno == ESRCH) {\r\n\t\t\t\t\t/* Process died before the signal was sent */\r\n\t\t\t\t\tzend_accel_error(ACCEL_LOG_WARNING, \"Process %d died before SIGKILL was sent\", mem_usage_check->l_pid);\r\n\t\t\t\t\tsuccess = 1;\r\n\t\t\t\t}\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t/* give it a chance to die */\r\n\t\t\tusleep(20000);\r\n\t\t\tif (kill(mem_usage_check->l_pid, 0)) {\r\n\t\t\t\tif (errno == ESRCH) {\r\n\t\t\t\t\t/* successfully killed locker, process no longer exists  */\r\n\t\t\t\t\tzend_accel_error(ACCEL_LOG_WARNING, \"Killed locker %d\", mem_usage_check->l_pid);\r\n\t\t\t\t\tsuccess = 1;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tusleep(10000);\r\n\t\t}\r\n\t\tif (!success) {\r\n\t\t\t/* errno is not ESRCH or we ran out of tries to kill the locker */\r\n\t\t\tZCSG(force_restart_time) = time(NULL); /* restore forced restart request */\r\n\t\t\t/* cannot kill the locker, bail out with error */\r\n\t\t\tzend_accel_error(ACCEL_LOG_ERROR, \"Cannot kill process %d: %s!\", mem_usage_check->l_pid, strerror(errno));\r\n\t\t}\r\n```\r\n\r\nIf so let me do some testing on the code and I will push the changes up."}}
{"actor":{"display_login":"mhagstrand"}}