{"action":"created","comment":{"url":"https://api.github.com/repos/oetiker/rrdtool-1.x/pulls/comments/42865002","id":42865002,"diff_hunk":"@@ -832,16 +832,28 @@ static char *day(\n \n static mutex_t parsetime_mutex = MUTEX_INITIALIZER;\n \n+static char     *rrd_parsetime_nomt(\n+    const char *tspec,\n+    rrd_time_value_t * ptv);\n+    \n char     *rrd_parsetime(\n     const char *tspec,\n     rrd_time_value_t * ptv)\n {\n-    time_t    now = time(NULL);\n-    int       hr = 0;\n-\n     /* yes this code is non re-entrant ... so lets make sure we do not run\n        in twice */\n     mutex_lock(&parsetime_mutex);\n+    char *result = rrd_parsetime_nomt(tspec, ptv);\n+    mutex_unlock(&parsetime_mutex);","path":"src/rrd_parsetime.c","position":19,"original_position":19,"commit_id":"f98a7f1579136d31f46f1481ea96b4a1141103e5","original_commit_id":"f98a7f1579136d31f46f1481ea96b4a1141103e5","user":{"login":"ufo-dd","id":15254002,"avatar_url":"https://avatars.githubusercontent.com/u/15254002?v=3","gravatar_id":"","url":"https://api.github.com/users/ufo-dd","html_url":"https://github.com/ufo-dd","followers_url":"https://api.github.com/users/ufo-dd/followers","following_url":"https://api.github.com/users/ufo-dd/following{/other_user}","gists_url":"https://api.github.com/users/ufo-dd/gists{/gist_id}","starred_url":"https://api.github.com/users/ufo-dd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ufo-dd/subscriptions","organizations_url":"https://api.github.com/users/ufo-dd/orgs","repos_url":"https://api.github.com/users/ufo-dd/repos","events_url":"https://api.github.com/users/ufo-dd/events{/privacy}","received_events_url":"https://api.github.com/users/ufo-dd/received_events","type":"User","site_admin":false},"body":"Oh yes, I overlooked this.\nSorry this is my first pull request. How is the workflow now?\nAnd I see, that I also have to think about the EnsureFreeMem at the end.\n\n2015-10-23 15:29 GMT+02:00 Tobias Oetiker <notifications@github.com>:\n\n> In src/rrd_parsetime.c\n> <https://github.com/oetiker/rrdtool-1.x/pull/678#discussion_r42864280>:\n>\n> >      /* yes this code is non re-entrant ... so lets make sure we do not run\n> >         in twice */\n> >      mutex_lock(&parsetime_mutex);\n> > +    char *result = rrd_parsetime_nomt(tspec, ptv);\n> > +    mutex_unlock(&parsetime_mutex);\n>\n> shouldn't you then get rid of the original unlock line ? (1009 after this\n> patch)\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/oetiker/rrdtool-1.x/pull/678/files#r42864280>.\n>\n","created_at":"2015-10-23T13:37:31Z","updated_at":"2015-10-23T13:37:31Z","html_url":"https://github.com/oetiker/rrdtool-1.x/pull/678#discussion_r42865002","pull_request_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/pulls/678","_links":{"self":{"href":"https://api.github.com/repos/oetiker/rrdtool-1.x/pulls/comments/42865002"},"html":{"href":"https://github.com/oetiker/rrdtool-1.x/pull/678#discussion_r42865002"},"pull_request":{"href":"https://api.github.com/repos/oetiker/rrdtool-1.x/pulls/678"}}},"pull_request":{"url":"https://api.github.com/repos/oetiker/rrdtool-1.x/pulls/678","id":48579181,"html_url":"https://github.com/oetiker/rrdtool-1.x/pull/678","diff_url":"https://github.com/oetiker/rrdtool-1.x/pull/678.diff","patch_url":"https://github.com/oetiker/rrdtool-1.x/pull/678.patch","issue_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/issues/678","number":678,"state":"open","locked":false,"title":"rrd_parsetime now unlocks its mutex also after parsing errors.","user":{"login":"ufo-dd","id":15254002,"avatar_url":"https://avatars.githubusercontent.com/u/15254002?v=3","gravatar_id":"","url":"https://api.github.com/users/ufo-dd","html_url":"https://github.com/ufo-dd","followers_url":"https://api.github.com/users/ufo-dd/followers","following_url":"https://api.github.com/users/ufo-dd/following{/other_user}","gists_url":"https://api.github.com/users/ufo-dd/gists{/gist_id}","starred_url":"https://api.github.com/users/ufo-dd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ufo-dd/subscriptions","organizations_url":"https://api.github.com/users/ufo-dd/orgs","repos_url":"https://api.github.com/users/ufo-dd/repos","events_url":"https://api.github.com/users/ufo-dd/events{/privacy}","received_events_url":"https://api.github.com/users/ufo-dd/received_events","type":"User","site_admin":false},"body":"Hello,\r\nI have found a problematic behaviour in rrd_parsetime. When rrd_xport is called multiple times in a process and there are errors in parsing --start or --end parameters, the process blocks endless because the parsetime_mutex is locked.\r\nThe reason is, that try() and panic() leaving the function without unlocking the mutex.","created_at":"2015-10-23T13:23:16Z","updated_at":"2015-10-23T13:37:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3b81f6cdecfa60cb67f1cbd03fa2c883377e5c24","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/pulls/678/commits","review_comments_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/pulls/678/comments","review_comment_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/issues/678/comments","statuses_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/statuses/f98a7f1579136d31f46f1481ea96b4a1141103e5","head":{"label":"ufo-dd:1.5","ref":"1.5","sha":"f98a7f1579136d31f46f1481ea96b4a1141103e5","user":{"login":"ufo-dd","id":15254002,"avatar_url":"https://avatars.githubusercontent.com/u/15254002?v=3","gravatar_id":"","url":"https://api.github.com/users/ufo-dd","html_url":"https://github.com/ufo-dd","followers_url":"https://api.github.com/users/ufo-dd/followers","following_url":"https://api.github.com/users/ufo-dd/following{/other_user}","gists_url":"https://api.github.com/users/ufo-dd/gists{/gist_id}","starred_url":"https://api.github.com/users/ufo-dd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ufo-dd/subscriptions","organizations_url":"https://api.github.com/users/ufo-dd/orgs","repos_url":"https://api.github.com/users/ufo-dd/repos","events_url":"https://api.github.com/users/ufo-dd/events{/privacy}","received_events_url":"https://api.github.com/users/ufo-dd/received_events","type":"User","site_admin":false},"repo":{"id":44787263,"name":"rrdtool-1.x","full_name":"ufo-dd/rrdtool-1.x","owner":{"login":"ufo-dd","id":15254002,"avatar_url":"https://avatars.githubusercontent.com/u/15254002?v=3","gravatar_id":"","url":"https://api.github.com/users/ufo-dd","html_url":"https://github.com/ufo-dd","followers_url":"https://api.github.com/users/ufo-dd/followers","following_url":"https://api.github.com/users/ufo-dd/following{/other_user}","gists_url":"https://api.github.com/users/ufo-dd/gists{/gist_id}","starred_url":"https://api.github.com/users/ufo-dd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ufo-dd/subscriptions","organizations_url":"https://api.github.com/users/ufo-dd/orgs","repos_url":"https://api.github.com/users/ufo-dd/repos","events_url":"https://api.github.com/users/ufo-dd/events{/privacy}","received_events_url":"https://api.github.com/users/ufo-dd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ufo-dd/rrdtool-1.x","description":"RRDtool 1.x - Round Robin Database","fork":true,"url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x","forks_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/forks","keys_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/teams","hooks_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/hooks","issue_events_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/issues/events{/number}","events_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/events","assignees_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/assignees{/user}","branches_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/branches{/branch}","tags_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/tags","blobs_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/git/refs{/sha}","trees_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/statuses/{sha}","languages_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/languages","stargazers_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/stargazers","contributors_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/contributors","subscribers_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/subscribers","subscription_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/subscription","commits_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/commits{/sha}","git_commits_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/git/commits{/sha}","comments_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/comments{/number}","issue_comment_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/issues/comments{/number}","contents_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/contents/{+path}","compare_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/merges","archive_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/downloads","issues_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/issues{/number}","pulls_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/pulls{/number}","milestones_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/milestones{/number}","notifications_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/labels{/name}","releases_url":"https://api.github.com/repos/ufo-dd/rrdtool-1.x/releases{/id}","created_at":"2015-10-23T02:56:54Z","updated_at":"2015-10-23T02:56:57Z","pushed_at":"2015-10-23T13:11:40Z","git_url":"git://github.com/ufo-dd/rrdtool-1.x.git","ssh_url":"git@github.com:ufo-dd/rrdtool-1.x.git","clone_url":"https://github.com/ufo-dd/rrdtool-1.x.git","svn_url":"https://github.com/ufo-dd/rrdtool-1.x","homepage":"http://www.rrdtool.org","size":15513,"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":"oetiker:1.5","ref":"1.5","sha":"5b4eac6c774027933d85400297f0f15a5c191dd4","user":{"login":"oetiker","id":429279,"avatar_url":"https://avatars.githubusercontent.com/u/429279?v=3","gravatar_id":"","url":"https://api.github.com/users/oetiker","html_url":"https://github.com/oetiker","followers_url":"https://api.github.com/users/oetiker/followers","following_url":"https://api.github.com/users/oetiker/following{/other_user}","gists_url":"https://api.github.com/users/oetiker/gists{/gist_id}","starred_url":"https://api.github.com/users/oetiker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oetiker/subscriptions","organizations_url":"https://api.github.com/users/oetiker/orgs","repos_url":"https://api.github.com/users/oetiker/repos","events_url":"https://api.github.com/users/oetiker/events{/privacy}","received_events_url":"https://api.github.com/users/oetiker/received_events","type":"User","site_admin":false},"repo":{"id":5761553,"name":"rrdtool-1.x","full_name":"oetiker/rrdtool-1.x","owner":{"login":"oetiker","id":429279,"avatar_url":"https://avatars.githubusercontent.com/u/429279?v=3","gravatar_id":"","url":"https://api.github.com/users/oetiker","html_url":"https://github.com/oetiker","followers_url":"https://api.github.com/users/oetiker/followers","following_url":"https://api.github.com/users/oetiker/following{/other_user}","gists_url":"https://api.github.com/users/oetiker/gists{/gist_id}","starred_url":"https://api.github.com/users/oetiker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oetiker/subscriptions","organizations_url":"https://api.github.com/users/oetiker/orgs","repos_url":"https://api.github.com/users/oetiker/repos","events_url":"https://api.github.com/users/oetiker/events{/privacy}","received_events_url":"https://api.github.com/users/oetiker/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oetiker/rrdtool-1.x","description":"RRDtool 1.x - Round Robin Database","fork":false,"url":"https://api.github.com/repos/oetiker/rrdtool-1.x","forks_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/forks","keys_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/teams","hooks_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/hooks","issue_events_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/issues/events{/number}","events_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/events","assignees_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/assignees{/user}","branches_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/branches{/branch}","tags_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/tags","blobs_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/git/refs{/sha}","trees_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/statuses/{sha}","languages_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/languages","stargazers_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/stargazers","contributors_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/contributors","subscribers_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/subscribers","subscription_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/subscription","commits_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/commits{/sha}","git_commits_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/git/commits{/sha}","comments_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/comments{/number}","issue_comment_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/issues/comments{/number}","contents_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/contents/{+path}","compare_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/merges","archive_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/downloads","issues_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/issues{/number}","pulls_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/pulls{/number}","milestones_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/milestones{/number}","notifications_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/labels{/name}","releases_url":"https://api.github.com/repos/oetiker/rrdtool-1.x/releases{/id}","created_at":"2012-09-11T07:41:14Z","updated_at":"2015-10-19T09:55:10Z","pushed_at":"2015-10-23T13:23:16Z","git_url":"git://github.com/oetiker/rrdtool-1.x.git","ssh_url":"git@github.com:oetiker/rrdtool-1.x.git","clone_url":"https://github.com/oetiker/rrdtool-1.x.git","svn_url":"https://github.com/oetiker/rrdtool-1.x","homepage":"http://www.rrdtool.org","size":15513,"stargazers_count":238,"watchers_count":238,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":113,"mirror_url":null,"open_issues_count":86,"forks":113,"open_issues":86,"watchers":238,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/oetiker/rrdtool-1.x/pulls/678"},"html":{"href":"https://github.com/oetiker/rrdtool-1.x/pull/678"},"issue":{"href":"https://api.github.com/repos/oetiker/rrdtool-1.x/issues/678"},"comments":{"href":"https://api.github.com/repos/oetiker/rrdtool-1.x/issues/678/comments"},"review_comments":{"href":"https://api.github.com/repos/oetiker/rrdtool-1.x/pulls/678/comments"},"review_comment":{"href":"https://api.github.com/repos/oetiker/rrdtool-1.x/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oetiker/rrdtool-1.x/pulls/678/commits"},"statuses":{"href":"https://api.github.com/repos/oetiker/rrdtool-1.x/statuses/f98a7f1579136d31f46f1481ea96b4a1141103e5"}}}}