{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/sonic-swss/pulls/comments/212532128","pull_request_review_id":149187062,"id":212532128,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMjUzMjEyOA==","diff_hunk":"@@ -96,6 +97,34 @@ bool WarmStart::checkWarmStart(const std::string &app_name, const std::string &d\n     return true;\n }\n \n+/*\n+ * Get warmStartTimer for an application in a docker (default to be swss)\n+ * return value 0 = OK,  -1 = failure\n+ * timer value is saved to timer_value if succeed. timer value 0 is invalid.\n+ */\n+int WarmStart::getWarmStartTimer(uint32_t &timer_value, const std::string &app_name,\n+    const std::string &docker_name)\n+{\n+    auto& warmStart = getInstance();\n+    std::string timer_name = app_name + \"_timer\";\n+    std::string timer_value_str;\n+\n+    warmStart.m_cfgWarmRestartTable->hget(docker_name, timer_name, timer_value_str);\n+\n+    unsigned long int temp_value = strtoul(timer_value_str.c_str(), NULL, 0);\n+    if (temp_value != 0 && temp_value != LONG_MAX)","path":"warmrestart/warm_restart.cpp","position":null,"original_position":27,"commit_id":"8af327048b8337f8f65b75e00f120bd1fe75982d","original_commit_id":"f451c8fa2ae3089dcf761f5f47e75ecb22c70a85","user":{"login":"zhenggen-xu","id":17014390,"node_id":"MDQ6VXNlcjE3MDE0Mzkw","avatar_url":"https://avatars0.githubusercontent.com/u/17014390?v=4","gravatar_id":"","url":"https://api.github.com/users/zhenggen-xu","html_url":"https://github.com/zhenggen-xu","followers_url":"https://api.github.com/users/zhenggen-xu/followers","following_url":"https://api.github.com/users/zhenggen-xu/following{/other_user}","gists_url":"https://api.github.com/users/zhenggen-xu/gists{/gist_id}","starred_url":"https://api.github.com/users/zhenggen-xu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhenggen-xu/subscriptions","organizations_url":"https://api.github.com/users/zhenggen-xu/orgs","repos_url":"https://api.github.com/users/zhenggen-xu/repos","events_url":"https://api.github.com/users/zhenggen-xu/events{/privacy}","received_events_url":"https://api.github.com/users/zhenggen-xu/received_events","type":"User","site_admin":false},"body":"Yes,  the CLI part will do the error checking when write to the configDB. \r\nstrtoul return 0 or ULONG_MAX as invalid values.  Range check is added.","created_at":"2018-08-24T06:29:10Z","updated_at":"2018-08-24T06:29:10Z","html_url":"https://github.com/Azure/sonic-swss/pull/589#discussion_r212532128","pull_request_url":"https://api.github.com/repos/Azure/sonic-swss/pulls/589","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Azure/sonic-swss/pulls/comments/212532128"},"html":{"href":"https://github.com/Azure/sonic-swss/pull/589#discussion_r212532128"},"pull_request":{"href":"https://api.github.com/repos/Azure/sonic-swss/pulls/589"}},"in_reply_to_id":212089371},"pull_request":{"url":"https://api.github.com/repos/Azure/sonic-swss/pulls/589","id":209997351,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5OTk3MzUx","html_url":"https://github.com/Azure/sonic-swss/pull/589","diff_url":"https://github.com/Azure/sonic-swss/pull/589.diff","patch_url":"https://github.com/Azure/sonic-swss/pull/589.patch","issue_url":"https://api.github.com/repos/Azure/sonic-swss/issues/589","number":589,"state":"open","locked":false,"title":"Add a common function to get the warm-start timer","user":{"login":"zhenggen-xu","id":17014390,"node_id":"MDQ6VXNlcjE3MDE0Mzkw","avatar_url":"https://avatars0.githubusercontent.com/u/17014390?v=4","gravatar_id":"","url":"https://api.github.com/users/zhenggen-xu","html_url":"https://github.com/zhenggen-xu","followers_url":"https://api.github.com/users/zhenggen-xu/followers","following_url":"https://api.github.com/users/zhenggen-xu/following{/other_user}","gists_url":"https://api.github.com/users/zhenggen-xu/gists{/gist_id}","starred_url":"https://api.github.com/users/zhenggen-xu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhenggen-xu/subscriptions","organizations_url":"https://api.github.com/users/zhenggen-xu/orgs","repos_url":"https://api.github.com/users/zhenggen-xu/repos","events_url":"https://api.github.com/users/zhenggen-xu/events{/privacy}","received_events_url":"https://api.github.com/users/zhenggen-xu/received_events","type":"User","site_admin":false},"body":"<!--\r\nPlease make sure you have read and understood the contribution guildlines:\r\nhttps://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md\r\n\r\n1. Make sure your commit includes a signature generted with `git commit -s`\r\n2. Make sure your commit title follows the correct format: [component]: description\r\n3. Make sure your commit message contains enough details about the change and related tests\r\n4. Make sure your pull request adds related reviewers, asignees, labels\r\n\r\nPlease also provide the following information in this pull request:\r\n-->\r\n\r\n**What I did**\r\nSimplify the timer schema\r\nAdd a common function to get the warm-start timer\r\n\r\n**Why I did it**\r\nUse the same function for different timers.\r\n\r\n**How I verified it**\r\n\r\n**Details if related**\r\n","created_at":"2018-08-22T01:23:23Z","updated_at":"2018-08-24T06:29:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f196456fe52366702bb968e8fc09c853f83d2526","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":338891657,"node_id":"MDU6TGFiZWwzMzg4OTE2NTc=","url":"https://api.github.com/repos/Azure/sonic-swss/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/sonic-swss/pulls/589/commits","review_comments_url":"https://api.github.com/repos/Azure/sonic-swss/pulls/589/comments","review_comment_url":"https://api.github.com/repos/Azure/sonic-swss/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/sonic-swss/issues/589/comments","statuses_url":"https://api.github.com/repos/Azure/sonic-swss/statuses/8af327048b8337f8f65b75e00f120bd1fe75982d","head":{"label":"zhenggen-xu:getWarmStartTimer","ref":"getWarmStartTimer","sha":"8af327048b8337f8f65b75e00f120bd1fe75982d","user":{"login":"zhenggen-xu","id":17014390,"node_id":"MDQ6VXNlcjE3MDE0Mzkw","avatar_url":"https://avatars0.githubusercontent.com/u/17014390?v=4","gravatar_id":"","url":"https://api.github.com/users/zhenggen-xu","html_url":"https://github.com/zhenggen-xu","followers_url":"https://api.github.com/users/zhenggen-xu/followers","following_url":"https://api.github.com/users/zhenggen-xu/following{/other_user}","gists_url":"https://api.github.com/users/zhenggen-xu/gists{/gist_id}","starred_url":"https://api.github.com/users/zhenggen-xu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhenggen-xu/subscriptions","organizations_url":"https://api.github.com/users/zhenggen-xu/orgs","repos_url":"https://api.github.com/users/zhenggen-xu/repos","events_url":"https://api.github.com/users/zhenggen-xu/events{/privacy}","received_events_url":"https://api.github.com/users/zhenggen-xu/received_events","type":"User","site_admin":false},"repo":{"id":98849176,"node_id":"MDEwOlJlcG9zaXRvcnk5ODg0OTE3Ng==","name":"sonic-swss","full_name":"zhenggen-xu/sonic-swss","owner":{"login":"zhenggen-xu","id":17014390,"node_id":"MDQ6VXNlcjE3MDE0Mzkw","avatar_url":"https://avatars0.githubusercontent.com/u/17014390?v=4","gravatar_id":"","url":"https://api.github.com/users/zhenggen-xu","html_url":"https://github.com/zhenggen-xu","followers_url":"https://api.github.com/users/zhenggen-xu/followers","following_url":"https://api.github.com/users/zhenggen-xu/following{/other_user}","gists_url":"https://api.github.com/users/zhenggen-xu/gists{/gist_id}","starred_url":"https://api.github.com/users/zhenggen-xu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhenggen-xu/subscriptions","organizations_url":"https://api.github.com/users/zhenggen-xu/orgs","repos_url":"https://api.github.com/users/zhenggen-xu/repos","events_url":"https://api.github.com/users/zhenggen-xu/events{/privacy}","received_events_url":"https://api.github.com/users/zhenggen-xu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zhenggen-xu/sonic-swss","description":"SONiC Switch State Service (SwSS)","fork":true,"url":"https://api.github.com/repos/zhenggen-xu/sonic-swss","forks_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/forks","keys_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/teams","hooks_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/hooks","issue_events_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/issues/events{/number}","events_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/events","assignees_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/assignees{/user}","branches_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/branches{/branch}","tags_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/tags","blobs_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/git/refs{/sha}","trees_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/statuses/{sha}","languages_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/languages","stargazers_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/stargazers","contributors_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/contributors","subscribers_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/subscribers","subscription_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/subscription","commits_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/commits{/sha}","git_commits_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/git/commits{/sha}","comments_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/comments{/number}","issue_comment_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/issues/comments{/number}","contents_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/contents/{+path}","compare_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/merges","archive_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/downloads","issues_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/issues{/number}","pulls_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/pulls{/number}","milestones_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/milestones{/number}","notifications_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/labels{/name}","releases_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/releases{/id}","deployments_url":"https://api.github.com/repos/zhenggen-xu/sonic-swss/deployments","created_at":"2017-07-31T04:50:09Z","updated_at":"2018-08-21T06:01:33Z","pushed_at":"2018-08-24T06:28:05Z","git_url":"git://github.com/zhenggen-xu/sonic-swss.git","ssh_url":"git@github.com:zhenggen-xu/sonic-swss.git","clone_url":"https://github.com/zhenggen-xu/sonic-swss.git","svn_url":"https://github.com/zhenggen-xu/sonic-swss","homepage":"https://azure.github.io/SONiC","size":1865,"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":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Azure:master","ref":"master","sha":"bff03e9a522ec0b76939c58da7b3749f33b3366a","user":{"login":"Azure","id":6844498,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDQ0OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":53515475,"node_id":"MDEwOlJlcG9zaXRvcnk1MzUxNTQ3NQ==","name":"sonic-swss","full_name":"Azure/sonic-swss","owner":{"login":"Azure","id":6844498,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDQ0OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/sonic-swss","description":"SONiC Switch State Service (SwSS)","fork":false,"url":"https://api.github.com/repos/Azure/sonic-swss","forks_url":"https://api.github.com/repos/Azure/sonic-swss/forks","keys_url":"https://api.github.com/repos/Azure/sonic-swss/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/sonic-swss/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/sonic-swss/teams","hooks_url":"https://api.github.com/repos/Azure/sonic-swss/hooks","issue_events_url":"https://api.github.com/repos/Azure/sonic-swss/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/sonic-swss/events","assignees_url":"https://api.github.com/repos/Azure/sonic-swss/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/sonic-swss/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/sonic-swss/tags","blobs_url":"https://api.github.com/repos/Azure/sonic-swss/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/sonic-swss/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/sonic-swss/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/sonic-swss/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/sonic-swss/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/sonic-swss/languages","stargazers_url":"https://api.github.com/repos/Azure/sonic-swss/stargazers","contributors_url":"https://api.github.com/repos/Azure/sonic-swss/contributors","subscribers_url":"https://api.github.com/repos/Azure/sonic-swss/subscribers","subscription_url":"https://api.github.com/repos/Azure/sonic-swss/subscription","commits_url":"https://api.github.com/repos/Azure/sonic-swss/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/sonic-swss/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/sonic-swss/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/sonic-swss/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/sonic-swss/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/sonic-swss/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/sonic-swss/merges","archive_url":"https://api.github.com/repos/Azure/sonic-swss/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/sonic-swss/downloads","issues_url":"https://api.github.com/repos/Azure/sonic-swss/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/sonic-swss/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/sonic-swss/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/sonic-swss/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/sonic-swss/labels{/name}","releases_url":"https://api.github.com/repos/Azure/sonic-swss/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/sonic-swss/deployments","created_at":"2016-03-09T17:01:09Z","updated_at":"2018-08-23T21:53:29Z","pushed_at":"2018-08-24T06:28:06Z","git_url":"git://github.com/Azure/sonic-swss.git","ssh_url":"git@github.com:Azure/sonic-swss.git","clone_url":"https://github.com/Azure/sonic-swss.git","svn_url":"https://github.com/Azure/sonic-swss","homepage":"https://azure.github.io/SONiC","size":1804,"stargazers_count":35,"watchers_count":35,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":67,"mirror_url":null,"archived":false,"open_issues_count":60,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":67,"open_issues":60,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/sonic-swss/pulls/589"},"html":{"href":"https://github.com/Azure/sonic-swss/pull/589"},"issue":{"href":"https://api.github.com/repos/Azure/sonic-swss/issues/589"},"comments":{"href":"https://api.github.com/repos/Azure/sonic-swss/issues/589/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/sonic-swss/pulls/589/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/sonic-swss/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/sonic-swss/pulls/589/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/sonic-swss/statuses/8af327048b8337f8f65b75e00f120bd1fe75982d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"zhenggen-xu"}}