{"action":"created","comment":{"url":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/comments/43362904","id":43362904,"diff_hunk":"@@ -76,10 +85,23 @@ def getTimeLeft( self, cpuConsumed = 0.0 ):\n       return resourceDict\n \n     resources = resourceDict['Value']\n-    if not resources['CPULimit'] or not resources['WallClockLimit']:\n+    self.log.verbose( resources )\n+    if not resources['CPULimit'] and not resources['WallClockLimit']:\n       # This should never happen\n       return S_ERROR( 'No CPU or WallClock limit obtained' )\n \n+    # if one of CPULimit or WallClockLimit is missing, compute a reasonable value\n+    if not resources['CPULimit']:\n+      resources['CPULimit'] = resources['WallClockLimit']","path":"Core/Utilities/TimeLeft/TimeLeft.py","position":30,"original_position":30,"commit_id":"41f9fd85cf689774303026ada652c721884fe528","original_commit_id":"31eb5b681191e50b5aa1ea15e66e61bd219b4e68","user":{"login":"phicharp","id":792975,"avatar_url":"https://avatars.githubusercontent.com/u/792975?v=3","gravatar_id":"","url":"https://api.github.com/users/phicharp","html_url":"https://github.com/phicharp","followers_url":"https://api.github.com/users/phicharp/followers","following_url":"https://api.github.com/users/phicharp/following{/other_user}","gists_url":"https://api.github.com/users/phicharp/gists{/gist_id}","starred_url":"https://api.github.com/users/phicharp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phicharp/subscriptions","organizations_url":"https://api.github.com/users/phicharp/orgs","repos_url":"https://api.github.com/users/phicharp/repos","events_url":"https://api.github.com/users/phicharp/events{/privacy}","received_events_url":"https://api.github.com/users/phicharp/received_events","type":"User","site_admin":false},"body":"I agree, but we had recently an example where this was causing problems as the site had set CPULimit = 0.7*WallClockLimit but for a strange reason the CPULimit was not exposed :(\r\nJobs were killed by CPU limit then as it was reached before the WallClockLimit was reached... I agree it would be a hack rather than a real fix for a missing value as the factor would be random... An alternative is to just return an error if CPULimit is not provided by WallClockLimit is.","created_at":"2015-10-29T09:12:46Z","updated_at":"2015-10-29T09:12:46Z","html_url":"https://github.com/DIRACGrid/DIRAC/pull/2680#discussion_r43362904","pull_request_url":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/2680","_links":{"self":{"href":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/comments/43362904"},"html":{"href":"https://github.com/DIRACGrid/DIRAC/pull/2680#discussion_r43362904"},"pull_request":{"href":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/2680"}}},"pull_request":{"url":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/2680","id":48847895,"html_url":"https://github.com/DIRACGrid/DIRAC/pull/2680","diff_url":"https://github.com/DIRACGrid/DIRAC/pull/2680.diff","patch_url":"https://github.com/DIRACGrid/DIRAC/pull/2680.patch","issue_url":"https://api.github.com/repos/DIRACGrid/DIRAC/issues/2680","number":2680,"state":"open","locked":false,"title":"[v6r15] move missing wc/cpu time workaround fixes from batchPlugins to TimeLeft","user":{"login":"pigay","id":754327,"avatar_url":"https://avatars.githubusercontent.com/u/754327?v=3","gravatar_id":"","url":"https://api.github.com/users/pigay","html_url":"https://github.com/pigay","followers_url":"https://api.github.com/users/pigay/followers","following_url":"https://api.github.com/users/pigay/following{/other_user}","gists_url":"https://api.github.com/users/pigay/gists{/gist_id}","starred_url":"https://api.github.com/users/pigay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pigay/subscriptions","organizations_url":"https://api.github.com/users/pigay/orgs","repos_url":"https://api.github.com/users/pigay/repos","events_url":"https://api.github.com/users/pigay/events{/privacy}","received_events_url":"https://api.github.com/users/pigay/received_events","type":"User","site_admin":false},"body":"The batch plugins won't mix CPU and walltime values anymore, missing values are handled by the TimeLeft object.\r\n\r\nThis is the first part of the replacement of #2629","created_at":"2015-10-27T09:49:18Z","updated_at":"2015-10-29T09:12:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"97d57bd3e8b85f7961472b05cfe0d8bcfe68d3c5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/2680/commits","review_comments_url":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/2680/comments","review_comment_url":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DIRACGrid/DIRAC/issues/2680/comments","statuses_url":"https://api.github.com/repos/DIRACGrid/DIRAC/statuses/41f9fd85cf689774303026ada652c721884fe528","head":{"label":"pigay:timeleft-handles-missing-plugin-values","ref":"timeleft-handles-missing-plugin-values","sha":"41f9fd85cf689774303026ada652c721884fe528","user":{"login":"pigay","id":754327,"avatar_url":"https://avatars.githubusercontent.com/u/754327?v=3","gravatar_id":"","url":"https://api.github.com/users/pigay","html_url":"https://github.com/pigay","followers_url":"https://api.github.com/users/pigay/followers","following_url":"https://api.github.com/users/pigay/following{/other_user}","gists_url":"https://api.github.com/users/pigay/gists{/gist_id}","starred_url":"https://api.github.com/users/pigay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pigay/subscriptions","organizations_url":"https://api.github.com/users/pigay/orgs","repos_url":"https://api.github.com/users/pigay/repos","events_url":"https://api.github.com/users/pigay/events{/privacy}","received_events_url":"https://api.github.com/users/pigay/received_events","type":"User","site_admin":false},"repo":{"id":9367950,"name":"DIRAC","full_name":"pigay/DIRAC","owner":{"login":"pigay","id":754327,"avatar_url":"https://avatars.githubusercontent.com/u/754327?v=3","gravatar_id":"","url":"https://api.github.com/users/pigay","html_url":"https://github.com/pigay","followers_url":"https://api.github.com/users/pigay/followers","following_url":"https://api.github.com/users/pigay/following{/other_user}","gists_url":"https://api.github.com/users/pigay/gists{/gist_id}","starred_url":"https://api.github.com/users/pigay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pigay/subscriptions","organizations_url":"https://api.github.com/users/pigay/orgs","repos_url":"https://api.github.com/users/pigay/repos","events_url":"https://api.github.com/users/pigay/events{/privacy}","received_events_url":"https://api.github.com/users/pigay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pigay/DIRAC","description":"DIRAC Grid","fork":true,"url":"https://api.github.com/repos/pigay/DIRAC","forks_url":"https://api.github.com/repos/pigay/DIRAC/forks","keys_url":"https://api.github.com/repos/pigay/DIRAC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pigay/DIRAC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pigay/DIRAC/teams","hooks_url":"https://api.github.com/repos/pigay/DIRAC/hooks","issue_events_url":"https://api.github.com/repos/pigay/DIRAC/issues/events{/number}","events_url":"https://api.github.com/repos/pigay/DIRAC/events","assignees_url":"https://api.github.com/repos/pigay/DIRAC/assignees{/user}","branches_url":"https://api.github.com/repos/pigay/DIRAC/branches{/branch}","tags_url":"https://api.github.com/repos/pigay/DIRAC/tags","blobs_url":"https://api.github.com/repos/pigay/DIRAC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pigay/DIRAC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pigay/DIRAC/git/refs{/sha}","trees_url":"https://api.github.com/repos/pigay/DIRAC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pigay/DIRAC/statuses/{sha}","languages_url":"https://api.github.com/repos/pigay/DIRAC/languages","stargazers_url":"https://api.github.com/repos/pigay/DIRAC/stargazers","contributors_url":"https://api.github.com/repos/pigay/DIRAC/contributors","subscribers_url":"https://api.github.com/repos/pigay/DIRAC/subscribers","subscription_url":"https://api.github.com/repos/pigay/DIRAC/subscription","commits_url":"https://api.github.com/repos/pigay/DIRAC/commits{/sha}","git_commits_url":"https://api.github.com/repos/pigay/DIRAC/git/commits{/sha}","comments_url":"https://api.github.com/repos/pigay/DIRAC/comments{/number}","issue_comment_url":"https://api.github.com/repos/pigay/DIRAC/issues/comments{/number}","contents_url":"https://api.github.com/repos/pigay/DIRAC/contents/{+path}","compare_url":"https://api.github.com/repos/pigay/DIRAC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pigay/DIRAC/merges","archive_url":"https://api.github.com/repos/pigay/DIRAC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pigay/DIRAC/downloads","issues_url":"https://api.github.com/repos/pigay/DIRAC/issues{/number}","pulls_url":"https://api.github.com/repos/pigay/DIRAC/pulls{/number}","milestones_url":"https://api.github.com/repos/pigay/DIRAC/milestones{/number}","notifications_url":"https://api.github.com/repos/pigay/DIRAC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pigay/DIRAC/labels{/name}","releases_url":"https://api.github.com/repos/pigay/DIRAC/releases{/id}","created_at":"2013-04-11T10:40:23Z","updated_at":"2014-06-13T20:53:26Z","pushed_at":"2015-10-29T08:59:34Z","git_url":"git://github.com/pigay/DIRAC.git","ssh_url":"git@github.com:pigay/DIRAC.git","clone_url":"https://github.com/pigay/DIRAC.git","svn_url":"https://github.com/pigay/DIRAC","homepage":"http://diracgrid.org","size":27374,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"integration"}},"base":{"label":"DIRACGrid:rel-v6r15","ref":"rel-v6r15","sha":"8f0a60d1276fdcb6a0ff84e385f2c479a6ebf24b","user":{"login":"DIRACGrid","id":694842,"avatar_url":"https://avatars.githubusercontent.com/u/694842?v=3","gravatar_id":"","url":"https://api.github.com/users/DIRACGrid","html_url":"https://github.com/DIRACGrid","followers_url":"https://api.github.com/users/DIRACGrid/followers","following_url":"https://api.github.com/users/DIRACGrid/following{/other_user}","gists_url":"https://api.github.com/users/DIRACGrid/gists{/gist_id}","starred_url":"https://api.github.com/users/DIRACGrid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DIRACGrid/subscriptions","organizations_url":"https://api.github.com/users/DIRACGrid/orgs","repos_url":"https://api.github.com/users/DIRACGrid/repos","events_url":"https://api.github.com/users/DIRACGrid/events{/privacy}","received_events_url":"https://api.github.com/users/DIRACGrid/received_events","type":"Organization","site_admin":false},"repo":{"id":1576831,"name":"DIRAC","full_name":"DIRACGrid/DIRAC","owner":{"login":"DIRACGrid","id":694842,"avatar_url":"https://avatars.githubusercontent.com/u/694842?v=3","gravatar_id":"","url":"https://api.github.com/users/DIRACGrid","html_url":"https://github.com/DIRACGrid","followers_url":"https://api.github.com/users/DIRACGrid/followers","following_url":"https://api.github.com/users/DIRACGrid/following{/other_user}","gists_url":"https://api.github.com/users/DIRACGrid/gists{/gist_id}","starred_url":"https://api.github.com/users/DIRACGrid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DIRACGrid/subscriptions","organizations_url":"https://api.github.com/users/DIRACGrid/orgs","repos_url":"https://api.github.com/users/DIRACGrid/repos","events_url":"https://api.github.com/users/DIRACGrid/events{/privacy}","received_events_url":"https://api.github.com/users/DIRACGrid/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DIRACGrid/DIRAC","description":"DIRAC Grid","fork":false,"url":"https://api.github.com/repos/DIRACGrid/DIRAC","forks_url":"https://api.github.com/repos/DIRACGrid/DIRAC/forks","keys_url":"https://api.github.com/repos/DIRACGrid/DIRAC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DIRACGrid/DIRAC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DIRACGrid/DIRAC/teams","hooks_url":"https://api.github.com/repos/DIRACGrid/DIRAC/hooks","issue_events_url":"https://api.github.com/repos/DIRACGrid/DIRAC/issues/events{/number}","events_url":"https://api.github.com/repos/DIRACGrid/DIRAC/events","assignees_url":"https://api.github.com/repos/DIRACGrid/DIRAC/assignees{/user}","branches_url":"https://api.github.com/repos/DIRACGrid/DIRAC/branches{/branch}","tags_url":"https://api.github.com/repos/DIRACGrid/DIRAC/tags","blobs_url":"https://api.github.com/repos/DIRACGrid/DIRAC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DIRACGrid/DIRAC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DIRACGrid/DIRAC/git/refs{/sha}","trees_url":"https://api.github.com/repos/DIRACGrid/DIRAC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DIRACGrid/DIRAC/statuses/{sha}","languages_url":"https://api.github.com/repos/DIRACGrid/DIRAC/languages","stargazers_url":"https://api.github.com/repos/DIRACGrid/DIRAC/stargazers","contributors_url":"https://api.github.com/repos/DIRACGrid/DIRAC/contributors","subscribers_url":"https://api.github.com/repos/DIRACGrid/DIRAC/subscribers","subscription_url":"https://api.github.com/repos/DIRACGrid/DIRAC/subscription","commits_url":"https://api.github.com/repos/DIRACGrid/DIRAC/commits{/sha}","git_commits_url":"https://api.github.com/repos/DIRACGrid/DIRAC/git/commits{/sha}","comments_url":"https://api.github.com/repos/DIRACGrid/DIRAC/comments{/number}","issue_comment_url":"https://api.github.com/repos/DIRACGrid/DIRAC/issues/comments{/number}","contents_url":"https://api.github.com/repos/DIRACGrid/DIRAC/contents/{+path}","compare_url":"https://api.github.com/repos/DIRACGrid/DIRAC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DIRACGrid/DIRAC/merges","archive_url":"https://api.github.com/repos/DIRACGrid/DIRAC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DIRACGrid/DIRAC/downloads","issues_url":"https://api.github.com/repos/DIRACGrid/DIRAC/issues{/number}","pulls_url":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls{/number}","milestones_url":"https://api.github.com/repos/DIRACGrid/DIRAC/milestones{/number}","notifications_url":"https://api.github.com/repos/DIRACGrid/DIRAC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DIRACGrid/DIRAC/labels{/name}","releases_url":"https://api.github.com/repos/DIRACGrid/DIRAC/releases{/id}","created_at":"2011-04-06T11:47:53Z","updated_at":"2015-08-23T15:07:00Z","pushed_at":"2015-10-29T09:06:46Z","git_url":"git://github.com/DIRACGrid/DIRAC.git","ssh_url":"git@github.com:DIRACGrid/DIRAC.git","clone_url":"https://github.com/DIRACGrid/DIRAC.git","svn_url":"https://github.com/DIRACGrid/DIRAC","homepage":"http://diracgrid.org","size":67937,"stargazers_count":44,"watchers_count":44,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":87,"mirror_url":null,"open_issues_count":130,"forks":87,"open_issues":130,"watchers":44,"default_branch":"integration"}},"_links":{"self":{"href":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/2680"},"html":{"href":"https://github.com/DIRACGrid/DIRAC/pull/2680"},"issue":{"href":"https://api.github.com/repos/DIRACGrid/DIRAC/issues/2680"},"comments":{"href":"https://api.github.com/repos/DIRACGrid/DIRAC/issues/2680/comments"},"review_comments":{"href":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/2680/comments"},"review_comment":{"href":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/2680/commits"},"statuses":{"href":"https://api.github.com/repos/DIRACGrid/DIRAC/statuses/41f9fd85cf689774303026ada652c721884fe528"}}}}