{"action":"created","comment":{"url":"https://api.github.com/repos/percona/PerconaFT/pulls/comments/180997505","pull_request_review_id":111518145,"id":180997505,"diff_hunk":"@@ -72,70 +80,124 @@ void toku_fs_get_write_info(time_t *enospc_last_time, uint64_t *enospc_current,\n     *enospc_total = toku_write_enospc_total;\n }\n \n-//Print any necessary errors\n-//Return whether we should try the write again.\n-static void\n-try_again_after_handling_write_error(int fd, size_t len, ssize_t r_write) {\n-    int try_again = 0;\n-\n-    assert(r_write < 0);\n-    int errno_write = get_error_errno();\n-    switch (errno_write) {\n-    case EINTR: { //The call was interrupted by a signal before any data was written; see signal(7).\n-\tchar err_msg[sizeof(\"Write of [] bytes to fd=[] interrupted.  Retrying.\") + 20+10]; //64 bit is 20 chars, 32 bit is 10 chars\n-\tsnprintf(err_msg, sizeof(err_msg), \"Write of [%\" PRIu64 \"] bytes to fd=[%d] interrupted.  Retrying.\", (uint64_t)len, fd);\n-\tperror(err_msg);\n-\tfflush(stderr);\n-\ttry_again = 1;\n-\tbreak;\n-    }\n-    case ENOSPC: {\n-        if (toku_assert_on_write_enospc) {\n-            char err_msg[sizeof(\"Failed write of [] bytes to fd=[].\") + 20+10]; //64 bit is 20 chars, 32 bit is 10 chars\n-            snprintf(err_msg, sizeof(err_msg), \"Failed write of [%\" PRIu64 \"] bytes to fd=[%d].\", (uint64_t)len, fd);\n-            perror(err_msg);\n-            fflush(stderr);\n-            int out_of_disk_space = 1;\n-            assert(!out_of_disk_space); //Give an error message that might be useful if this is the only one that survives.\n-        } else {\n-            toku_sync_fetch_and_add(&toku_write_enospc_total, 1);\n-            toku_sync_fetch_and_add(&toku_write_enospc_current, 1);\n-\n-            time_t tnow = time(0);\n-            toku_write_enospc_last_time = tnow;\n-            if (toku_write_enospc_last_report == 0 || tnow - toku_write_enospc_last_report >= 60) {\n-                toku_write_enospc_last_report = tnow;\n-\n-                const int tstr_length = 26;\n-                char tstr[tstr_length];\n-                time_t t = time(0);\n-                ctime_r(&t, tstr);\n-\n-                const int MY_MAX_PATH = 256;\n-                char fname[MY_MAX_PATH], symname[MY_MAX_PATH+1];\n-                sprintf(fname, \"/proc/%d/fd/%d\", getpid(), fd);\n-                ssize_t n = readlink(fname, symname, MY_MAX_PATH);\n-\n-                if ((int)n == -1)\n-                    fprintf(stderr, \"%.24s PerconaFT No space when writing %\" PRIu64 \" bytes to fd=%d \", tstr, (uint64_t) len, fd);\n-                else {\n-\t\t    tstr[n] = 0; // readlink doesn't append a NUL to the end of the buffer.\n-                    fprintf(stderr, \"%.24s PerconaFT No space when writing %\" PRIu64 \" bytes to %*s \", tstr, (uint64_t) len, (int) n, symname);\n-\t\t}\n-                fprintf(stderr, \"retry in %d second%s\\n\", toku_write_enospc_sleep, toku_write_enospc_sleep > 1 ? \"s\" : \"\");\n-                fflush(stderr);\n+static void __attribute__((format(printf, 2, 3)))\n+report_io_problem(int fd, const char *fmt, ...) {\n+    va_list ap;\n+    va_start(ap, fmt);\n+\n+    constexpr int tstr_length = 26;","path":"portability/file.cc","position":108,"original_position":108,"commit_id":"5287c284f1117b79129fadf61acfa243b8399cbb","original_commit_id":"5287c284f1117b79129fadf61acfa243b8399cbb","user":{"login":"laurynas-biveinis","id":58894,"avatar_url":"https://avatars3.githubusercontent.com/u/58894?v=4","gravatar_id":"","url":"https://api.github.com/users/laurynas-biveinis","html_url":"https://github.com/laurynas-biveinis","followers_url":"https://api.github.com/users/laurynas-biveinis/followers","following_url":"https://api.github.com/users/laurynas-biveinis/following{/other_user}","gists_url":"https://api.github.com/users/laurynas-biveinis/gists{/gist_id}","starred_url":"https://api.github.com/users/laurynas-biveinis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laurynas-biveinis/subscriptions","organizations_url":"https://api.github.com/users/laurynas-biveinis/orgs","repos_url":"https://api.github.com/users/laurynas-biveinis/repos","events_url":"https://api.github.com/users/laurynas-biveinis/events{/privacy}","received_events_url":"https://api.github.com/users/laurynas-biveinis/received_events","type":"User","site_admin":false},"body":"static constexpr (but only if there are other comments to address)","created_at":"2018-04-12T08:11:40Z","updated_at":"2018-04-12T08:16:16Z","html_url":"https://github.com/percona/PerconaFT/pull/410#discussion_r180997505","pull_request_url":"https://api.github.com/repos/percona/PerconaFT/pulls/410","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/percona/PerconaFT/pulls/comments/180997505"},"html":{"href":"https://github.com/percona/PerconaFT/pull/410#discussion_r180997505"},"pull_request":{"href":"https://api.github.com/repos/percona/PerconaFT/pulls/410"}}},"pull_request":{"url":"https://api.github.com/repos/percona/PerconaFT/pulls/410","id":180967191,"html_url":"https://github.com/percona/PerconaFT/pull/410","diff_url":"https://github.com/percona/PerconaFT/pull/410.diff","patch_url":"https://github.com/percona/PerconaFT/pull/410.patch","issue_url":"https://api.github.com/repos/percona/PerconaFT/issues/410","number":410,"state":"open","locked":false,"title":"TDB-184 : Broken fsync error handling","user":{"login":"georgelorchpercona","id":5247783,"avatar_url":"https://avatars2.githubusercontent.com/u/5247783?v=4","gravatar_id":"","url":"https://api.github.com/users/georgelorchpercona","html_url":"https://github.com/georgelorchpercona","followers_url":"https://api.github.com/users/georgelorchpercona/followers","following_url":"https://api.github.com/users/georgelorchpercona/following{/other_user}","gists_url":"https://api.github.com/users/georgelorchpercona/gists{/gist_id}","starred_url":"https://api.github.com/users/georgelorchpercona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgelorchpercona/subscriptions","organizations_url":"https://api.github.com/users/georgelorchpercona/orgs","repos_url":"https://api.github.com/users/georgelorchpercona/repos","events_url":"https://api.github.com/users/georgelorchpercona/events{/privacy}","received_events_url":"https://api.github.com/users/georgelorchpercona/received_events","type":"User","site_admin":false},"body":"- Factored out i/o error reporting to be common and try to obtain actual\r\n  filename from descriptor.\r\n- Fixed ENOSPC reporting to use common i/o reporting.\r\n- Fixed fsync retry logic to retry EINTR, EIO, and ENOLCK based on InnoDB code\r\n  and upstream mysql issues 34823 and 90296. Retry will print message every 100\r\n  attempts in a loop.\r\n- Touched up 'slow fsync' tracking and reporting to use new i/o error reporting.\r\n- Fixed close retry logic to be same as fsync.","created_at":"2018-04-11T16:56:01Z","updated_at":"2018-04-12T08:16:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dde6d9dafb1afa3946e64f2ae4d56927c29d9b85","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/percona/PerconaFT/pulls/410/commits","review_comments_url":"https://api.github.com/repos/percona/PerconaFT/pulls/410/comments","review_comment_url":"https://api.github.com/repos/percona/PerconaFT/pulls/comments{/number}","comments_url":"https://api.github.com/repos/percona/PerconaFT/issues/410/comments","statuses_url":"https://api.github.com/repos/percona/PerconaFT/statuses/5287c284f1117b79129fadf61acfa243b8399cbb","head":{"label":"georgelorchpercona:TDB-184","ref":"TDB-184","sha":"5287c284f1117b79129fadf61acfa243b8399cbb","user":{"login":"georgelorchpercona","id":5247783,"avatar_url":"https://avatars2.githubusercontent.com/u/5247783?v=4","gravatar_id":"","url":"https://api.github.com/users/georgelorchpercona","html_url":"https://github.com/georgelorchpercona","followers_url":"https://api.github.com/users/georgelorchpercona/followers","following_url":"https://api.github.com/users/georgelorchpercona/following{/other_user}","gists_url":"https://api.github.com/users/georgelorchpercona/gists{/gist_id}","starred_url":"https://api.github.com/users/georgelorchpercona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgelorchpercona/subscriptions","organizations_url":"https://api.github.com/users/georgelorchpercona/orgs","repos_url":"https://api.github.com/users/georgelorchpercona/repos","events_url":"https://api.github.com/users/georgelorchpercona/events{/privacy}","received_events_url":"https://api.github.com/users/georgelorchpercona/received_events","type":"User","site_admin":false},"repo":{"id":35072413,"name":"PerconaFT","full_name":"georgelorchpercona/PerconaFT","owner":{"login":"georgelorchpercona","id":5247783,"avatar_url":"https://avatars2.githubusercontent.com/u/5247783?v=4","gravatar_id":"","url":"https://api.github.com/users/georgelorchpercona","html_url":"https://github.com/georgelorchpercona","followers_url":"https://api.github.com/users/georgelorchpercona/followers","following_url":"https://api.github.com/users/georgelorchpercona/following{/other_user}","gists_url":"https://api.github.com/users/georgelorchpercona/gists{/gist_id}","starred_url":"https://api.github.com/users/georgelorchpercona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgelorchpercona/subscriptions","organizations_url":"https://api.github.com/users/georgelorchpercona/orgs","repos_url":"https://api.github.com/users/georgelorchpercona/repos","events_url":"https://api.github.com/users/georgelorchpercona/events{/privacy}","received_events_url":"https://api.github.com/users/georgelorchpercona/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/georgelorchpercona/PerconaFT","description":"TokuFT is a high-performance, transactional key-value store","fork":true,"url":"https://api.github.com/repos/georgelorchpercona/PerconaFT","forks_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/forks","keys_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/teams","hooks_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/hooks","issue_events_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/issues/events{/number}","events_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/events","assignees_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/assignees{/user}","branches_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/branches{/branch}","tags_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/tags","blobs_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/git/refs{/sha}","trees_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/statuses/{sha}","languages_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/languages","stargazers_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/stargazers","contributors_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/contributors","subscribers_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/subscribers","subscription_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/subscription","commits_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/commits{/sha}","git_commits_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/git/commits{/sha}","comments_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/comments{/number}","issue_comment_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/issues/comments{/number}","contents_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/contents/{+path}","compare_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/merges","archive_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/downloads","issues_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/issues{/number}","pulls_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/pulls{/number}","milestones_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/milestones{/number}","notifications_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/labels{/name}","releases_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/releases{/id}","deployments_url":"https://api.github.com/repos/georgelorchpercona/PerconaFT/deployments","created_at":"2015-05-05T02:12:07Z","updated_at":"2017-08-09T13:54:09Z","pushed_at":"2018-04-11T19:34:06Z","git_url":"git://github.com/georgelorchpercona/PerconaFT.git","ssh_url":"git@github.com:georgelorchpercona/PerconaFT.git","clone_url":"https://github.com/georgelorchpercona/PerconaFT.git","svn_url":"https://github.com/georgelorchpercona/PerconaFT","homepage":"http://www.tokutek.com/","size":25370,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"percona:master","ref":"master","sha":"f02e0f418da6a361f2fc42413094a46f2b1860e1","user":{"login":"percona","id":1683025,"avatar_url":"https://avatars0.githubusercontent.com/u/1683025?v=4","gravatar_id":"","url":"https://api.github.com/users/percona","html_url":"https://github.com/percona","followers_url":"https://api.github.com/users/percona/followers","following_url":"https://api.github.com/users/percona/following{/other_user}","gists_url":"https://api.github.com/users/percona/gists{/gist_id}","starred_url":"https://api.github.com/users/percona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/percona/subscriptions","organizations_url":"https://api.github.com/users/percona/orgs","repos_url":"https://api.github.com/users/percona/repos","events_url":"https://api.github.com/users/percona/events{/privacy}","received_events_url":"https://api.github.com/users/percona/received_events","type":"Organization","site_admin":false},"repo":{"id":9465623,"name":"PerconaFT","full_name":"percona/PerconaFT","owner":{"login":"percona","id":1683025,"avatar_url":"https://avatars0.githubusercontent.com/u/1683025?v=4","gravatar_id":"","url":"https://api.github.com/users/percona","html_url":"https://github.com/percona","followers_url":"https://api.github.com/users/percona/followers","following_url":"https://api.github.com/users/percona/following{/other_user}","gists_url":"https://api.github.com/users/percona/gists{/gist_id}","starred_url":"https://api.github.com/users/percona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/percona/subscriptions","organizations_url":"https://api.github.com/users/percona/orgs","repos_url":"https://api.github.com/users/percona/repos","events_url":"https://api.github.com/users/percona/events{/privacy}","received_events_url":"https://api.github.com/users/percona/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/percona/PerconaFT","description":"PerconaFT is a high-performance, transactional key-value store","fork":false,"url":"https://api.github.com/repos/percona/PerconaFT","forks_url":"https://api.github.com/repos/percona/PerconaFT/forks","keys_url":"https://api.github.com/repos/percona/PerconaFT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/percona/PerconaFT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/percona/PerconaFT/teams","hooks_url":"https://api.github.com/repos/percona/PerconaFT/hooks","issue_events_url":"https://api.github.com/repos/percona/PerconaFT/issues/events{/number}","events_url":"https://api.github.com/repos/percona/PerconaFT/events","assignees_url":"https://api.github.com/repos/percona/PerconaFT/assignees{/user}","branches_url":"https://api.github.com/repos/percona/PerconaFT/branches{/branch}","tags_url":"https://api.github.com/repos/percona/PerconaFT/tags","blobs_url":"https://api.github.com/repos/percona/PerconaFT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/percona/PerconaFT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/percona/PerconaFT/git/refs{/sha}","trees_url":"https://api.github.com/repos/percona/PerconaFT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/percona/PerconaFT/statuses/{sha}","languages_url":"https://api.github.com/repos/percona/PerconaFT/languages","stargazers_url":"https://api.github.com/repos/percona/PerconaFT/stargazers","contributors_url":"https://api.github.com/repos/percona/PerconaFT/contributors","subscribers_url":"https://api.github.com/repos/percona/PerconaFT/subscribers","subscription_url":"https://api.github.com/repos/percona/PerconaFT/subscription","commits_url":"https://api.github.com/repos/percona/PerconaFT/commits{/sha}","git_commits_url":"https://api.github.com/repos/percona/PerconaFT/git/commits{/sha}","comments_url":"https://api.github.com/repos/percona/PerconaFT/comments{/number}","issue_comment_url":"https://api.github.com/repos/percona/PerconaFT/issues/comments{/number}","contents_url":"https://api.github.com/repos/percona/PerconaFT/contents/{+path}","compare_url":"https://api.github.com/repos/percona/PerconaFT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/percona/PerconaFT/merges","archive_url":"https://api.github.com/repos/percona/PerconaFT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/percona/PerconaFT/downloads","issues_url":"https://api.github.com/repos/percona/PerconaFT/issues{/number}","pulls_url":"https://api.github.com/repos/percona/PerconaFT/pulls{/number}","milestones_url":"https://api.github.com/repos/percona/PerconaFT/milestones{/number}","notifications_url":"https://api.github.com/repos/percona/PerconaFT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/percona/PerconaFT/labels{/name}","releases_url":"https://api.github.com/repos/percona/PerconaFT/releases{/id}","deployments_url":"https://api.github.com/repos/percona/PerconaFT/deployments","created_at":"2013-04-16T06:14:08Z","updated_at":"2018-04-10T09:10:21Z","pushed_at":"2018-04-11T19:34:08Z","git_url":"git://github.com/percona/PerconaFT.git","ssh_url":"git@github.com:percona/PerconaFT.git","clone_url":"https://github.com/percona/PerconaFT.git","svn_url":"https://github.com/percona/PerconaFT","homepage":"http://www.percona.com/","size":24863,"stargazers_count":429,"watchers_count":429,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":81,"mirror_url":null,"archived":false,"open_issues_count":16,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":81,"open_issues":16,"watchers":429,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/percona/PerconaFT/pulls/410"},"html":{"href":"https://github.com/percona/PerconaFT/pull/410"},"issue":{"href":"https://api.github.com/repos/percona/PerconaFT/issues/410"},"comments":{"href":"https://api.github.com/repos/percona/PerconaFT/issues/410/comments"},"review_comments":{"href":"https://api.github.com/repos/percona/PerconaFT/pulls/410/comments"},"review_comment":{"href":"https://api.github.com/repos/percona/PerconaFT/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/percona/PerconaFT/pulls/410/commits"},"statuses":{"href":"https://api.github.com/repos/percona/PerconaFT/statuses/5287c284f1117b79129fadf61acfa243b8399cbb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"laurynas-biveinis"}}