{"action":"created","comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/195451742","pull_request_review_id":128823847,"id":195451742,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTQ1MTc0Mg==","diff_hunk":"@@ -0,0 +1,5 @@\n+Thread names in logs\n+--------------------\n+\n+Log lines are now prefixed by default with the name of the thread that caused","path":"doc/release-notes-pr13168.md","position":null,"original_position":4,"commit_id":"d09f1f09ab4483551a56b2126473438aee99d69e","original_commit_id":"d1385ab370b6100bd920ceb817688655b94c650e","user":{"login":"jamesob","id":73197,"node_id":"MDQ6VXNlcjczMTk3","avatar_url":"https://avatars0.githubusercontent.com/u/73197?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesob","html_url":"https://github.com/jamesob","followers_url":"https://api.github.com/users/jamesob/followers","following_url":"https://api.github.com/users/jamesob/following{/other_user}","gists_url":"https://api.github.com/users/jamesob/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesob/subscriptions","organizations_url":"https://api.github.com/users/jamesob/orgs","repos_url":"https://api.github.com/users/jamesob/repos","events_url":"https://api.github.com/users/jamesob/events{/privacy}","received_events_url":"https://api.github.com/users/jamesob/received_events","type":"User","site_admin":false},"body":"Fixed, thanks.","created_at":"2018-06-14T14:45:26Z","updated_at":"2018-06-14T14:45:26Z","html_url":"https://github.com/bitcoin/bitcoin/pull/13168#discussion_r195451742","pull_request_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13168","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/195451742"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/13168#discussion_r195451742"},"pull_request":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13168"}},"in_reply_to_id":195135941},"pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13168","id":186103221,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg2MTAzMjIx","html_url":"https://github.com/bitcoin/bitcoin/pull/13168","diff_url":"https://github.com/bitcoin/bitcoin/pull/13168.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/13168.patch","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/13168","number":13168,"state":"open","locked":false,"title":"Thread names in logs and deadlock debug tools (take 2)","user":{"login":"jamesob","id":73197,"node_id":"MDQ6VXNlcjczMTk3","avatar_url":"https://avatars0.githubusercontent.com/u/73197?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesob","html_url":"https://github.com/jamesob","followers_url":"https://api.github.com/users/jamesob/followers","following_url":"https://api.github.com/users/jamesob/following{/other_user}","gists_url":"https://api.github.com/users/jamesob/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesob/subscriptions","organizations_url":"https://api.github.com/users/jamesob/orgs","repos_url":"https://api.github.com/users/jamesob/repos","events_url":"https://api.github.com/users/jamesob/events{/privacy}","received_events_url":"https://api.github.com/users/jamesob/received_events","type":"User","site_admin":false},"body":"Replaces #13099.\r\n\r\nThe goal here is the same as the previous PR, but this approach ~~uses @theuni's gracefully degrading thread-local caching strategy to avoid (when possible) map lookup and mutex overhead during thread name lookup~~ only includes threadnames in logs when we can make use of `thread_local`. We specifically `#undef HAVE_THREAD_LOCAL` for platforms where its presence or implementation is questionable (`__APPLE__`, `WIN32`).\r\n\r\nInstead of using a mutex-protected map to generate numeric suffixes (e.g. `httpworker.2`) we explicitly pass in suffixes during thread creation.\r\n\r\nThe logging format is also slightly different:\r\n```\r\n2018-06-13T21:43:28Z [bitcoin-qt-init] init message: Starting network threads...\r\n2018-06-13T21:43:28Z [net] net thread start\r\n2018-06-13T21:43:28Z [bitcoin-qt-init] init message: Done loading\r\n2018-06-13T21:43:28Z [opencon] opencon thread start\r\n2018-06-13T21:43:28Z [msghand] msghand thread start\r\n2018-06-13T21:43:28Z [dnsseed] dnsseed thread start\r\n2018-06-13T21:43:28Z [dnsseed] Loading addresses from DNS seeds (could take a while)\r\n2018-06-13T21:43:28Z [dnsseed] 0 addresses found from DNS seeds\r\n2018-06-13T21:43:28Z [dnsseed] dnsseed thread exit\r\n2018-06-13T21:43:28Z [addcon] addcon thread start\r\n2018-06-13T21:43:28Z [bitcoin-qt] GUI: Platform customization: \"other\"\r\n2018-06-13T21:43:28Z [bitcoin-qt] GUI: PaymentServer::LoadRootCAs: Loaded  146  root certificates\r\n2018-06-13T21:43:28Z [loadblk] Loaded 1 blocks from external file in 147ms\r\n2018-06-13T21:43:28Z [loadblk] Reindexing finished\r\n2018-06-13T21:43:28Z [loadblk] Imported mempool transactions from disk: 0 succeeded, 0 failed, 0 expired, 0 already there\r\n\r\n```","created_at":"2018-05-04T21:01:19Z","updated_at":"2018-06-14T14:45:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dbe95fb58ddd299df029ced40b0a741f8e82fd50","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":241832923,"node_id":"MDU6TGFiZWwyNDE4MzI5MjM=","url":"https://api.github.com/repos/bitcoin/bitcoin/labels/Utils/log/libs","name":"Utils/log/libs","color":"5319e7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13168/commits","review_comments_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13168/comments","review_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/13168/comments","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/d09f1f09ab4483551a56b2126473438aee99d69e","head":{"label":"jamesob:2018-05-threadnames-take-2","ref":"2018-05-threadnames-take-2","sha":"d09f1f09ab4483551a56b2126473438aee99d69e","user":{"login":"jamesob","id":73197,"node_id":"MDQ6VXNlcjczMTk3","avatar_url":"https://avatars0.githubusercontent.com/u/73197?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesob","html_url":"https://github.com/jamesob","followers_url":"https://api.github.com/users/jamesob/followers","following_url":"https://api.github.com/users/jamesob/following{/other_user}","gists_url":"https://api.github.com/users/jamesob/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesob/subscriptions","organizations_url":"https://api.github.com/users/jamesob/orgs","repos_url":"https://api.github.com/users/jamesob/repos","events_url":"https://api.github.com/users/jamesob/events{/privacy}","received_events_url":"https://api.github.com/users/jamesob/received_events","type":"User","site_admin":false},"repo":{"id":42077031,"node_id":"MDEwOlJlcG9zaXRvcnk0MjA3NzAzMQ==","name":"bitcoin","full_name":"jamesob/bitcoin","owner":{"login":"jamesob","id":73197,"node_id":"MDQ6VXNlcjczMTk3","avatar_url":"https://avatars0.githubusercontent.com/u/73197?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesob","html_url":"https://github.com/jamesob","followers_url":"https://api.github.com/users/jamesob/followers","following_url":"https://api.github.com/users/jamesob/following{/other_user}","gists_url":"https://api.github.com/users/jamesob/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesob/subscriptions","organizations_url":"https://api.github.com/users/jamesob/orgs","repos_url":"https://api.github.com/users/jamesob/repos","events_url":"https://api.github.com/users/jamesob/events{/privacy}","received_events_url":"https://api.github.com/users/jamesob/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jamesob/bitcoin","description":"Bitcoin Core integration/staging tree","fork":true,"url":"https://api.github.com/repos/jamesob/bitcoin","forks_url":"https://api.github.com/repos/jamesob/bitcoin/forks","keys_url":"https://api.github.com/repos/jamesob/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jamesob/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jamesob/bitcoin/teams","hooks_url":"https://api.github.com/repos/jamesob/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/jamesob/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/jamesob/bitcoin/events","assignees_url":"https://api.github.com/repos/jamesob/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/jamesob/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/jamesob/bitcoin/tags","blobs_url":"https://api.github.com/repos/jamesob/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jamesob/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jamesob/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jamesob/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jamesob/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/jamesob/bitcoin/languages","stargazers_url":"https://api.github.com/repos/jamesob/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/jamesob/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/jamesob/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/jamesob/bitcoin/subscription","commits_url":"https://api.github.com/repos/jamesob/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jamesob/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jamesob/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jamesob/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jamesob/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/jamesob/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jamesob/bitcoin/merges","archive_url":"https://api.github.com/repos/jamesob/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jamesob/bitcoin/downloads","issues_url":"https://api.github.com/repos/jamesob/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/jamesob/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/jamesob/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/jamesob/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jamesob/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/jamesob/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/jamesob/bitcoin/deployments","created_at":"2015-09-07T22:18:03Z","updated_at":"2018-04-04T14:39:13Z","pushed_at":"2018-06-14T14:13:51Z","git_url":"git://github.com/jamesob/bitcoin.git","ssh_url":"git@github.com:jamesob/bitcoin.git","clone_url":"https://github.com/jamesob/bitcoin.git","svn_url":"https://github.com/jamesob/bitcoin","homepage":"https://bitcoin.org/en/download","size":101897,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"bitcoin:master","ref":"master","sha":"4a7e64fc85461a205f2b51da52d1455795d43b91","user":{"login":"bitcoin","id":528860,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyODg2MA==","avatar_url":"https://avatars2.githubusercontent.com/u/528860?v=4","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"repo":{"id":1181927,"node_id":"MDEwOlJlcG9zaXRvcnkxMTgxOTI3","name":"bitcoin","full_name":"bitcoin/bitcoin","owner":{"login":"bitcoin","id":528860,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyODg2MA==","avatar_url":"https://avatars2.githubusercontent.com/u/528860?v=4","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bitcoin/bitcoin","description":"Bitcoin Core integration/staging tree","fork":false,"url":"https://api.github.com/repos/bitcoin/bitcoin","forks_url":"https://api.github.com/repos/bitcoin/bitcoin/forks","keys_url":"https://api.github.com/repos/bitcoin/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitcoin/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitcoin/bitcoin/teams","hooks_url":"https://api.github.com/repos/bitcoin/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/bitcoin/bitcoin/events","assignees_url":"https://api.github.com/repos/bitcoin/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/bitcoin/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/bitcoin/bitcoin/tags","blobs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitcoin/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitcoin/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/bitcoin/bitcoin/languages","stargazers_url":"https://api.github.com/repos/bitcoin/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/bitcoin/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/bitcoin/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/bitcoin/bitcoin/subscription","commits_url":"https://api.github.com/repos/bitcoin/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitcoin/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitcoin/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/bitcoin/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitcoin/bitcoin/merges","archive_url":"https://api.github.com/repos/bitcoin/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitcoin/bitcoin/downloads","issues_url":"https://api.github.com/repos/bitcoin/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/bitcoin/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/bitcoin/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/bitcoin/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/bitcoin/bitcoin/deployments","created_at":"2010-12-19T15:16:43Z","updated_at":"2018-06-14T14:45:19Z","pushed_at":"2018-06-14T14:27:24Z","git_url":"git://github.com/bitcoin/bitcoin.git","ssh_url":"git@github.com:bitcoin/bitcoin.git","clone_url":"https://github.com/bitcoin/bitcoin.git","svn_url":"https://github.com/bitcoin/bitcoin","homepage":"https://bitcoin.org/en/download","size":101489,"stargazers_count":32465,"watchers_count":32465,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":19498,"mirror_url":null,"archived":false,"open_issues_count":823,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":19498,"open_issues":823,"watchers":32465,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13168"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/13168"},"issue":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/13168"},"comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/13168/comments"},"review_comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13168/comments"},"review_comment":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13168/commits"},"statuses":{"href":"https://api.github.com/repos/bitcoin/bitcoin/statuses/d09f1f09ab4483551a56b2126473438aee99d69e"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"jamesob"}}