{"action":"created","comment":{"url":"https://api.github.com/repos/mongodb/mongo-c-driver/pulls/comments/39820385","id":39820385,"diff_hunk":"@@ -205,6 +205,7 @@ mongoc_write_concern_set_wtimeout (mongoc_write_concern_t *write_concern,\n                                    int32_t            wtimeout_msec)\n {\n    bson_return_if_fail(write_concern);\n+   bson_return_if_fail(wtimeout_msec >= 0);","path":"src/mongoc/mongoc-write-concern.c","position":4,"original_position":4,"commit_id":"3d154f2b28a7cae344e51dbda7ea7ec255dcba18","original_commit_id":"3d154f2b28a7cae344e51dbda7ea7ec255dcba18","user":{"login":"bjori","id":72407,"avatar_url":"https://avatars.githubusercontent.com/u/72407?v=3","gravatar_id":"","url":"https://api.github.com/users/bjori","html_url":"https://github.com/bjori","followers_url":"https://api.github.com/users/bjori/followers","following_url":"https://api.github.com/users/bjori/following{/other_user}","gists_url":"https://api.github.com/users/bjori/gists{/gist_id}","starred_url":"https://api.github.com/users/bjori/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjori/subscriptions","organizations_url":"https://api.github.com/users/bjori/orgs","repos_url":"https://api.github.com/users/bjori/repos","events_url":"https://api.github.com/users/bjori/events{/privacy}","received_events_url":"https://api.github.com/users/bjori/received_events","type":"User","site_admin":false},"body":"The MONGOC_WARNING() and friends are problematic for drivers built on top of mongoc.\r\nIt has no semantical understanding of what raised the warning or how to convey that to the caller.\r\n\r\nIf a function cal fail it must report that in form of a return value or out param. Or invent errno.\r\n\r\nThis specific case can be fixed by documenting it to be a programming error to pass wtimeout < 0, and say such value will be ignored.\r\n\r\nThe bson_return_if_fail() are for checking complex types/pointers, not to validate their value.\r\nIllegal values should be checked for by normal input validation.\r\n","created_at":"2015-09-18T02:51:07Z","updated_at":"2015-09-18T02:51:07Z","html_url":"https://github.com/mongodb/mongo-c-driver/pull/270#discussion_r39820385","pull_request_url":"https://api.github.com/repos/mongodb/mongo-c-driver/pulls/270","_links":{"self":{"href":"https://api.github.com/repos/mongodb/mongo-c-driver/pulls/comments/39820385"},"html":{"href":"https://github.com/mongodb/mongo-c-driver/pull/270#discussion_r39820385"},"pull_request":{"href":"https://api.github.com/repos/mongodb/mongo-c-driver/pulls/270"}}},"pull_request":{"url":"https://api.github.com/repos/mongodb/mongo-c-driver/pulls/270","id":45320137,"html_url":"https://github.com/mongodb/mongo-c-driver/pull/270","diff_url":"https://github.com/mongodb/mongo-c-driver/pull/270.diff","patch_url":"https://github.com/mongodb/mongo-c-driver/pull/270.patch","issue_url":"https://api.github.com/repos/mongodb/mongo-c-driver/issues/270","number":270,"state":"open","locked":false,"title":"CDRIVER-851: Negative wtimeout values are invalid","user":{"login":"jmikola","id":244663,"avatar_url":"https://avatars.githubusercontent.com/u/244663?v=3","gravatar_id":"","url":"https://api.github.com/users/jmikola","html_url":"https://github.com/jmikola","followers_url":"https://api.github.com/users/jmikola/followers","following_url":"https://api.github.com/users/jmikola/following{/other_user}","gists_url":"https://api.github.com/users/jmikola/gists{/gist_id}","starred_url":"https://api.github.com/users/jmikola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmikola/subscriptions","organizations_url":"https://api.github.com/users/jmikola/orgs","repos_url":"https://api.github.com/users/jmikola/repos","events_url":"https://api.github.com/users/jmikola/events{/privacy}","received_events_url":"https://api.github.com/users/jmikola/received_events","type":"User","site_admin":false},"body":"https://jira.mongodb.org/browse/CDRIVER-851","created_at":"2015-09-17T17:49:11Z","updated_at":"2015-09-18T02:51:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d5964c2ee7afd315ded0f5c03854f0f8a3fde743","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mongodb/mongo-c-driver/pulls/270/commits","review_comments_url":"https://api.github.com/repos/mongodb/mongo-c-driver/pulls/270/comments","review_comment_url":"https://api.github.com/repos/mongodb/mongo-c-driver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mongodb/mongo-c-driver/issues/270/comments","statuses_url":"https://api.github.com/repos/mongodb/mongo-c-driver/statuses/3d154f2b28a7cae344e51dbda7ea7ec255dcba18","head":{"label":"jmikola:cdriver-851","ref":"cdriver-851","sha":"3d154f2b28a7cae344e51dbda7ea7ec255dcba18","user":{"login":"jmikola","id":244663,"avatar_url":"https://avatars.githubusercontent.com/u/244663?v=3","gravatar_id":"","url":"https://api.github.com/users/jmikola","html_url":"https://github.com/jmikola","followers_url":"https://api.github.com/users/jmikola/followers","following_url":"https://api.github.com/users/jmikola/following{/other_user}","gists_url":"https://api.github.com/users/jmikola/gists{/gist_id}","starred_url":"https://api.github.com/users/jmikola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmikola/subscriptions","organizations_url":"https://api.github.com/users/jmikola/orgs","repos_url":"https://api.github.com/users/jmikola/repos","events_url":"https://api.github.com/users/jmikola/events{/privacy}","received_events_url":"https://api.github.com/users/jmikola/received_events","type":"User","site_admin":false},"repo":{"id":24768140,"name":"mongo-c-driver","full_name":"jmikola/mongo-c-driver","owner":{"login":"jmikola","id":244663,"avatar_url":"https://avatars.githubusercontent.com/u/244663?v=3","gravatar_id":"","url":"https://api.github.com/users/jmikola","html_url":"https://github.com/jmikola","followers_url":"https://api.github.com/users/jmikola/followers","following_url":"https://api.github.com/users/jmikola/following{/other_user}","gists_url":"https://api.github.com/users/jmikola/gists{/gist_id}","starred_url":"https://api.github.com/users/jmikola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmikola/subscriptions","organizations_url":"https://api.github.com/users/jmikola/orgs","repos_url":"https://api.github.com/users/jmikola/repos","events_url":"https://api.github.com/users/jmikola/events{/privacy}","received_events_url":"https://api.github.com/users/jmikola/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmikola/mongo-c-driver","description":"A high-performance MongoDB driver for C","fork":true,"url":"https://api.github.com/repos/jmikola/mongo-c-driver","forks_url":"https://api.github.com/repos/jmikola/mongo-c-driver/forks","keys_url":"https://api.github.com/repos/jmikola/mongo-c-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmikola/mongo-c-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmikola/mongo-c-driver/teams","hooks_url":"https://api.github.com/repos/jmikola/mongo-c-driver/hooks","issue_events_url":"https://api.github.com/repos/jmikola/mongo-c-driver/issues/events{/number}","events_url":"https://api.github.com/repos/jmikola/mongo-c-driver/events","assignees_url":"https://api.github.com/repos/jmikola/mongo-c-driver/assignees{/user}","branches_url":"https://api.github.com/repos/jmikola/mongo-c-driver/branches{/branch}","tags_url":"https://api.github.com/repos/jmikola/mongo-c-driver/tags","blobs_url":"https://api.github.com/repos/jmikola/mongo-c-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmikola/mongo-c-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmikola/mongo-c-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmikola/mongo-c-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmikola/mongo-c-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/jmikola/mongo-c-driver/languages","stargazers_url":"https://api.github.com/repos/jmikola/mongo-c-driver/stargazers","contributors_url":"https://api.github.com/repos/jmikola/mongo-c-driver/contributors","subscribers_url":"https://api.github.com/repos/jmikola/mongo-c-driver/subscribers","subscription_url":"https://api.github.com/repos/jmikola/mongo-c-driver/subscription","commits_url":"https://api.github.com/repos/jmikola/mongo-c-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmikola/mongo-c-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmikola/mongo-c-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmikola/mongo-c-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmikola/mongo-c-driver/contents/{+path}","compare_url":"https://api.github.com/repos/jmikola/mongo-c-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmikola/mongo-c-driver/merges","archive_url":"https://api.github.com/repos/jmikola/mongo-c-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmikola/mongo-c-driver/downloads","issues_url":"https://api.github.com/repos/jmikola/mongo-c-driver/issues{/number}","pulls_url":"https://api.github.com/repos/jmikola/mongo-c-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/jmikola/mongo-c-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/jmikola/mongo-c-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmikola/mongo-c-driver/labels{/name}","releases_url":"https://api.github.com/repos/jmikola/mongo-c-driver/releases{/id}","created_at":"2014-10-03T17:55:14Z","updated_at":"2015-04-23T18:15:31Z","pushed_at":"2015-09-17T17:48:33Z","git_url":"git://github.com/jmikola/mongo-c-driver.git","ssh_url":"git@github.com:jmikola/mongo-c-driver.git","clone_url":"https://github.com/jmikola/mongo-c-driver.git","svn_url":"https://github.com/jmikola/mongo-c-driver","homepage":"","size":11894,"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":"mongodb:1.2.0-dev","ref":"1.2.0-dev","sha":"8e1491432681946f59388ddb1bf80cbfe1f1d8f8","user":{"login":"mongodb","id":45120,"avatar_url":"https://avatars.githubusercontent.com/u/45120?v=3","gravatar_id":"","url":"https://api.github.com/users/mongodb","html_url":"https://github.com/mongodb","followers_url":"https://api.github.com/users/mongodb/followers","following_url":"https://api.github.com/users/mongodb/following{/other_user}","gists_url":"https://api.github.com/users/mongodb/gists{/gist_id}","starred_url":"https://api.github.com/users/mongodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mongodb/subscriptions","organizations_url":"https://api.github.com/users/mongodb/orgs","repos_url":"https://api.github.com/users/mongodb/repos","events_url":"https://api.github.com/users/mongodb/events{/privacy}","received_events_url":"https://api.github.com/users/mongodb/received_events","type":"Organization","site_admin":false},"repo":{"id":9735077,"name":"mongo-c-driver","full_name":"mongodb/mongo-c-driver","owner":{"login":"mongodb","id":45120,"avatar_url":"https://avatars.githubusercontent.com/u/45120?v=3","gravatar_id":"","url":"https://api.github.com/users/mongodb","html_url":"https://github.com/mongodb","followers_url":"https://api.github.com/users/mongodb/followers","following_url":"https://api.github.com/users/mongodb/following{/other_user}","gists_url":"https://api.github.com/users/mongodb/gists{/gist_id}","starred_url":"https://api.github.com/users/mongodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mongodb/subscriptions","organizations_url":"https://api.github.com/users/mongodb/orgs","repos_url":"https://api.github.com/users/mongodb/repos","events_url":"https://api.github.com/users/mongodb/events{/privacy}","received_events_url":"https://api.github.com/users/mongodb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mongodb/mongo-c-driver","description":"A high-performance MongoDB driver for C","fork":false,"url":"https://api.github.com/repos/mongodb/mongo-c-driver","forks_url":"https://api.github.com/repos/mongodb/mongo-c-driver/forks","keys_url":"https://api.github.com/repos/mongodb/mongo-c-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mongodb/mongo-c-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mongodb/mongo-c-driver/teams","hooks_url":"https://api.github.com/repos/mongodb/mongo-c-driver/hooks","issue_events_url":"https://api.github.com/repos/mongodb/mongo-c-driver/issues/events{/number}","events_url":"https://api.github.com/repos/mongodb/mongo-c-driver/events","assignees_url":"https://api.github.com/repos/mongodb/mongo-c-driver/assignees{/user}","branches_url":"https://api.github.com/repos/mongodb/mongo-c-driver/branches{/branch}","tags_url":"https://api.github.com/repos/mongodb/mongo-c-driver/tags","blobs_url":"https://api.github.com/repos/mongodb/mongo-c-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mongodb/mongo-c-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mongodb/mongo-c-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/mongodb/mongo-c-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mongodb/mongo-c-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/mongodb/mongo-c-driver/languages","stargazers_url":"https://api.github.com/repos/mongodb/mongo-c-driver/stargazers","contributors_url":"https://api.github.com/repos/mongodb/mongo-c-driver/contributors","subscribers_url":"https://api.github.com/repos/mongodb/mongo-c-driver/subscribers","subscription_url":"https://api.github.com/repos/mongodb/mongo-c-driver/subscription","commits_url":"https://api.github.com/repos/mongodb/mongo-c-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/mongodb/mongo-c-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/mongodb/mongo-c-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/mongodb/mongo-c-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/mongodb/mongo-c-driver/contents/{+path}","compare_url":"https://api.github.com/repos/mongodb/mongo-c-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mongodb/mongo-c-driver/merges","archive_url":"https://api.github.com/repos/mongodb/mongo-c-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mongodb/mongo-c-driver/downloads","issues_url":"https://api.github.com/repos/mongodb/mongo-c-driver/issues{/number}","pulls_url":"https://api.github.com/repos/mongodb/mongo-c-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/mongodb/mongo-c-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/mongodb/mongo-c-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mongodb/mongo-c-driver/labels{/name}","releases_url":"https://api.github.com/repos/mongodb/mongo-c-driver/releases{/id}","created_at":"2013-04-28T19:34:36Z","updated_at":"2015-09-17T03:39:15Z","pushed_at":"2015-09-17T21:14:45Z","git_url":"git://github.com/mongodb/mongo-c-driver.git","ssh_url":"git@github.com:mongodb/mongo-c-driver.git","clone_url":"https://github.com/mongodb/mongo-c-driver.git","svn_url":"https://github.com/mongodb/mongo-c-driver","homepage":"","size":19646,"stargazers_count":151,"watchers_count":151,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":115,"mirror_url":null,"open_issues_count":10,"forks":115,"open_issues":10,"watchers":151,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mongodb/mongo-c-driver/pulls/270"},"html":{"href":"https://github.com/mongodb/mongo-c-driver/pull/270"},"issue":{"href":"https://api.github.com/repos/mongodb/mongo-c-driver/issues/270"},"comments":{"href":"https://api.github.com/repos/mongodb/mongo-c-driver/issues/270/comments"},"review_comments":{"href":"https://api.github.com/repos/mongodb/mongo-c-driver/pulls/270/comments"},"review_comment":{"href":"https://api.github.com/repos/mongodb/mongo-c-driver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mongodb/mongo-c-driver/pulls/270/commits"},"statuses":{"href":"https://api.github.com/repos/mongodb/mongo-c-driver/statuses/3d154f2b28a7cae344e51dbda7ea7ec255dcba18"}}}}