{"action":"created","comment":{"url":"https://api.github.com/repos/spearhead-ea/island/pulls/comments/228009151","pull_request_review_id":168178311,"id":228009151,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyODAwOTE1MQ==","diff_hunk":"@@ -35,6 +35,29 @@ export class AmqpChannelPoolService {\n     logger.info(`connecting to broker ${util.inspect(options, { colors: true })}`);\n     try {\n       const connection = await amqp.connect(options.url, options.socketOptions);\n+      connection.on('error', () => {\n+        logger.debug(`amqp connection error occurred`);\n+      });\n+      connection.on('close', () => {\n+        logger.debug(`amqp connection closed.. terminate process`);\n+        if (process.env.ISLAND_USE_DEV_MODE === 'true') {\n+          console.log(`ignore process termination for ISLAND_USE_DEV_MODE`);\n+          return;\n+        }\n+        process.exit(1);\n+      });\n+      connection.on('blocked', reason => {\n+        // Emitted when a RabbitMQ server (after version 3.2.0) decides to block the connection.\n+        // Typically it will do this if there is some resource shortage,\n+        // e.g., memory, and messages are published on the connection.\n+        // See the RabbitMQ documentation for this extension for details.\n+        logger.debug(`amqp connection blocked. reason: ${reason}`);\n+        if (process.env.ISLAND_USE_DEV_MODE === 'true') {\n+          console.log(`ignore process termination for ISLAND_USE_DEV_MODE`);\n+          return;\n+        }\n+        process.exit(1);","path":"src/services/amqp-channel-pool-service.ts","position":25,"original_position":25,"commit_id":"e85c7a0d14bea9819f7e331ce5a2d5fffa508455","original_commit_id":"e85c7a0d14bea9819f7e331ce5a2d5fffa508455","user":{"login":"heycalmdown","id":154198,"node_id":"MDQ6VXNlcjE1NDE5OA==","avatar_url":"https://avatars1.githubusercontent.com/u/154198?v=4","gravatar_id":"","url":"https://api.github.com/users/heycalmdown","html_url":"https://github.com/heycalmdown","followers_url":"https://api.github.com/users/heycalmdown/followers","following_url":"https://api.github.com/users/heycalmdown/following{/other_user}","gists_url":"https://api.github.com/users/heycalmdown/gists{/gist_id}","starred_url":"https://api.github.com/users/heycalmdown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heycalmdown/subscriptions","organizations_url":"https://api.github.com/users/heycalmdown/orgs","repos_url":"https://api.github.com/users/heycalmdown/repos","events_url":"https://api.github.com/users/heycalmdown/events{/privacy}","received_events_url":"https://api.github.com/users/heycalmdown/received_events","type":"User","site_admin":false},"body":"The connection `block`ing can be issued in a short period, so `logger.info` would be enough for this. How about your thought?","created_at":"2018-10-25T01:18:59Z","updated_at":"2018-10-25T01:19:05Z","html_url":"https://github.com/spearhead-ea/island/pull/284#discussion_r228009151","pull_request_url":"https://api.github.com/repos/spearhead-ea/island/pulls/284","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/spearhead-ea/island/pulls/comments/228009151"},"html":{"href":"https://github.com/spearhead-ea/island/pull/284#discussion_r228009151"},"pull_request":{"href":"https://api.github.com/repos/spearhead-ea/island/pulls/284"}}},"pull_request":{"url":"https://api.github.com/repos/spearhead-ea/island/pulls/284","id":224158816,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0MTU4ODE2","html_url":"https://github.com/spearhead-ea/island/pull/284","diff_url":"https://github.com/spearhead-ea/island/pull/284.diff","patch_url":"https://github.com/spearhead-ea/island/pull/284.patch","issue_url":"https://api.github.com/repos/spearhead-ea/island/issues/284","number":284,"state":"open","locked":false,"title":"fix: added amqp connection event handlers","user":{"login":"sshtel","id":4931557,"node_id":"MDQ6VXNlcjQ5MzE1NTc=","avatar_url":"https://avatars0.githubusercontent.com/u/4931557?v=4","gravatar_id":"","url":"https://api.github.com/users/sshtel","html_url":"https://github.com/sshtel","followers_url":"https://api.github.com/users/sshtel/followers","following_url":"https://api.github.com/users/sshtel/following{/other_user}","gists_url":"https://api.github.com/users/sshtel/gists{/gist_id}","starred_url":"https://api.github.com/users/sshtel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sshtel/subscriptions","organizations_url":"https://api.github.com/users/sshtel/orgs","repos_url":"https://api.github.com/users/sshtel/repos","events_url":"https://api.github.com/users/sshtel/events{/privacy}","received_events_url":"https://api.github.com/users/sshtel/received_events","type":"User","site_admin":false},"body":"fix: added exception logic for unit test to NOT terminate process\r\n\r\nThis is to fix a bug that island process keeps alive when its AMQP connection is closed by external cause.\r\n\r\namqp.connection.on('close') handler is to terminate process when the connection is closed.\r\namqp.connection.on('error') handler is to store log. when 'error' event occurred, 'close' event will be emitted.\r\namqp.connection.on('blocked') handler is to terminate process when the connection is blocked by broker. reason of blocking situation varies by broker's condition.\r\n\r\nref: http://www.squaremobius.net/amqp.node/channel_api.html#models\r\n\r\n\r\n\r\nNOTE:\r\n.travis-ci is fixed to add `UNIT_TEST=true` env to ignore connection event handler for UNIT TEST process.\r\n\r\n","created_at":"2018-10-19T03:13:44Z","updated_at":"2018-10-25T01:19:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"61847c11c310d7ced9aec1c3d9ee6c843fae78bc","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/spearhead-ea/island/pulls/284/commits","review_comments_url":"https://api.github.com/repos/spearhead-ea/island/pulls/284/comments","review_comment_url":"https://api.github.com/repos/spearhead-ea/island/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spearhead-ea/island/issues/284/comments","statuses_url":"https://api.github.com/repos/spearhead-ea/island/statuses/e85c7a0d14bea9819f7e331ce5a2d5fffa508455","head":{"label":"spearhead-ea:fix.amqp.disconnect.alive","ref":"fix.amqp.disconnect.alive","sha":"e85c7a0d14bea9819f7e331ce5a2d5fffa508455","user":{"login":"spearhead-ea","id":8509910,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg1MDk5MTA=","avatar_url":"https://avatars3.githubusercontent.com/u/8509910?v=4","gravatar_id":"","url":"https://api.github.com/users/spearhead-ea","html_url":"https://github.com/spearhead-ea","followers_url":"https://api.github.com/users/spearhead-ea/followers","following_url":"https://api.github.com/users/spearhead-ea/following{/other_user}","gists_url":"https://api.github.com/users/spearhead-ea/gists{/gist_id}","starred_url":"https://api.github.com/users/spearhead-ea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spearhead-ea/subscriptions","organizations_url":"https://api.github.com/users/spearhead-ea/orgs","repos_url":"https://api.github.com/users/spearhead-ea/repos","events_url":"https://api.github.com/users/spearhead-ea/events{/privacy}","received_events_url":"https://api.github.com/users/spearhead-ea/received_events","type":"Organization","site_admin":false},"repo":{"id":30237331,"node_id":"MDEwOlJlcG9zaXRvcnkzMDIzNzMzMQ==","name":"island","full_name":"spearhead-ea/island","private":false,"owner":{"login":"spearhead-ea","id":8509910,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg1MDk5MTA=","avatar_url":"https://avatars3.githubusercontent.com/u/8509910?v=4","gravatar_id":"","url":"https://api.github.com/users/spearhead-ea","html_url":"https://github.com/spearhead-ea","followers_url":"https://api.github.com/users/spearhead-ea/followers","following_url":"https://api.github.com/users/spearhead-ea/following{/other_user}","gists_url":"https://api.github.com/users/spearhead-ea/gists{/gist_id}","starred_url":"https://api.github.com/users/spearhead-ea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spearhead-ea/subscriptions","organizations_url":"https://api.github.com/users/spearhead-ea/orgs","repos_url":"https://api.github.com/users/spearhead-ea/repos","events_url":"https://api.github.com/users/spearhead-ea/events{/privacy}","received_events_url":"https://api.github.com/users/spearhead-ea/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/spearhead-ea/island","description":"An opinionated, full-stacked Microservices framework for node, powered by TypeScript.","fork":false,"url":"https://api.github.com/repos/spearhead-ea/island","forks_url":"https://api.github.com/repos/spearhead-ea/island/forks","keys_url":"https://api.github.com/repos/spearhead-ea/island/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spearhead-ea/island/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spearhead-ea/island/teams","hooks_url":"https://api.github.com/repos/spearhead-ea/island/hooks","issue_events_url":"https://api.github.com/repos/spearhead-ea/island/issues/events{/number}","events_url":"https://api.github.com/repos/spearhead-ea/island/events","assignees_url":"https://api.github.com/repos/spearhead-ea/island/assignees{/user}","branches_url":"https://api.github.com/repos/spearhead-ea/island/branches{/branch}","tags_url":"https://api.github.com/repos/spearhead-ea/island/tags","blobs_url":"https://api.github.com/repos/spearhead-ea/island/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spearhead-ea/island/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spearhead-ea/island/git/refs{/sha}","trees_url":"https://api.github.com/repos/spearhead-ea/island/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spearhead-ea/island/statuses/{sha}","languages_url":"https://api.github.com/repos/spearhead-ea/island/languages","stargazers_url":"https://api.github.com/repos/spearhead-ea/island/stargazers","contributors_url":"https://api.github.com/repos/spearhead-ea/island/contributors","subscribers_url":"https://api.github.com/repos/spearhead-ea/island/subscribers","subscription_url":"https://api.github.com/repos/spearhead-ea/island/subscription","commits_url":"https://api.github.com/repos/spearhead-ea/island/commits{/sha}","git_commits_url":"https://api.github.com/repos/spearhead-ea/island/git/commits{/sha}","comments_url":"https://api.github.com/repos/spearhead-ea/island/comments{/number}","issue_comment_url":"https://api.github.com/repos/spearhead-ea/island/issues/comments{/number}","contents_url":"https://api.github.com/repos/spearhead-ea/island/contents/{+path}","compare_url":"https://api.github.com/repos/spearhead-ea/island/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spearhead-ea/island/merges","archive_url":"https://api.github.com/repos/spearhead-ea/island/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spearhead-ea/island/downloads","issues_url":"https://api.github.com/repos/spearhead-ea/island/issues{/number}","pulls_url":"https://api.github.com/repos/spearhead-ea/island/pulls{/number}","milestones_url":"https://api.github.com/repos/spearhead-ea/island/milestones{/number}","notifications_url":"https://api.github.com/repos/spearhead-ea/island/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spearhead-ea/island/labels{/name}","releases_url":"https://api.github.com/repos/spearhead-ea/island/releases{/id}","deployments_url":"https://api.github.com/repos/spearhead-ea/island/deployments","created_at":"2015-02-03T10:25:02Z","updated_at":"2018-10-24T08:30:34Z","pushed_at":"2018-10-25T01:03:19Z","git_url":"git://github.com/spearhead-ea/island.git","ssh_url":"git@github.com:spearhead-ea/island.git","clone_url":"https://github.com/spearhead-ea/island.git","svn_url":"https://github.com/spearhead-ea/island","homepage":"","size":1013,"stargazers_count":18,"watchers_count":18,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":16,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":16,"open_issues":19,"watchers":18,"default_branch":"master"}},"base":{"label":"spearhead-ea:master","ref":"master","sha":"32733cbe5c1b51bb58a96e66ca83d99fecb2592e","user":{"login":"spearhead-ea","id":8509910,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg1MDk5MTA=","avatar_url":"https://avatars3.githubusercontent.com/u/8509910?v=4","gravatar_id":"","url":"https://api.github.com/users/spearhead-ea","html_url":"https://github.com/spearhead-ea","followers_url":"https://api.github.com/users/spearhead-ea/followers","following_url":"https://api.github.com/users/spearhead-ea/following{/other_user}","gists_url":"https://api.github.com/users/spearhead-ea/gists{/gist_id}","starred_url":"https://api.github.com/users/spearhead-ea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spearhead-ea/subscriptions","organizations_url":"https://api.github.com/users/spearhead-ea/orgs","repos_url":"https://api.github.com/users/spearhead-ea/repos","events_url":"https://api.github.com/users/spearhead-ea/events{/privacy}","received_events_url":"https://api.github.com/users/spearhead-ea/received_events","type":"Organization","site_admin":false},"repo":{"id":30237331,"node_id":"MDEwOlJlcG9zaXRvcnkzMDIzNzMzMQ==","name":"island","full_name":"spearhead-ea/island","private":false,"owner":{"login":"spearhead-ea","id":8509910,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg1MDk5MTA=","avatar_url":"https://avatars3.githubusercontent.com/u/8509910?v=4","gravatar_id":"","url":"https://api.github.com/users/spearhead-ea","html_url":"https://github.com/spearhead-ea","followers_url":"https://api.github.com/users/spearhead-ea/followers","following_url":"https://api.github.com/users/spearhead-ea/following{/other_user}","gists_url":"https://api.github.com/users/spearhead-ea/gists{/gist_id}","starred_url":"https://api.github.com/users/spearhead-ea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spearhead-ea/subscriptions","organizations_url":"https://api.github.com/users/spearhead-ea/orgs","repos_url":"https://api.github.com/users/spearhead-ea/repos","events_url":"https://api.github.com/users/spearhead-ea/events{/privacy}","received_events_url":"https://api.github.com/users/spearhead-ea/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/spearhead-ea/island","description":"An opinionated, full-stacked Microservices framework for node, powered by TypeScript.","fork":false,"url":"https://api.github.com/repos/spearhead-ea/island","forks_url":"https://api.github.com/repos/spearhead-ea/island/forks","keys_url":"https://api.github.com/repos/spearhead-ea/island/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spearhead-ea/island/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spearhead-ea/island/teams","hooks_url":"https://api.github.com/repos/spearhead-ea/island/hooks","issue_events_url":"https://api.github.com/repos/spearhead-ea/island/issues/events{/number}","events_url":"https://api.github.com/repos/spearhead-ea/island/events","assignees_url":"https://api.github.com/repos/spearhead-ea/island/assignees{/user}","branches_url":"https://api.github.com/repos/spearhead-ea/island/branches{/branch}","tags_url":"https://api.github.com/repos/spearhead-ea/island/tags","blobs_url":"https://api.github.com/repos/spearhead-ea/island/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spearhead-ea/island/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spearhead-ea/island/git/refs{/sha}","trees_url":"https://api.github.com/repos/spearhead-ea/island/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spearhead-ea/island/statuses/{sha}","languages_url":"https://api.github.com/repos/spearhead-ea/island/languages","stargazers_url":"https://api.github.com/repos/spearhead-ea/island/stargazers","contributors_url":"https://api.github.com/repos/spearhead-ea/island/contributors","subscribers_url":"https://api.github.com/repos/spearhead-ea/island/subscribers","subscription_url":"https://api.github.com/repos/spearhead-ea/island/subscription","commits_url":"https://api.github.com/repos/spearhead-ea/island/commits{/sha}","git_commits_url":"https://api.github.com/repos/spearhead-ea/island/git/commits{/sha}","comments_url":"https://api.github.com/repos/spearhead-ea/island/comments{/number}","issue_comment_url":"https://api.github.com/repos/spearhead-ea/island/issues/comments{/number}","contents_url":"https://api.github.com/repos/spearhead-ea/island/contents/{+path}","compare_url":"https://api.github.com/repos/spearhead-ea/island/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spearhead-ea/island/merges","archive_url":"https://api.github.com/repos/spearhead-ea/island/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spearhead-ea/island/downloads","issues_url":"https://api.github.com/repos/spearhead-ea/island/issues{/number}","pulls_url":"https://api.github.com/repos/spearhead-ea/island/pulls{/number}","milestones_url":"https://api.github.com/repos/spearhead-ea/island/milestones{/number}","notifications_url":"https://api.github.com/repos/spearhead-ea/island/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spearhead-ea/island/labels{/name}","releases_url":"https://api.github.com/repos/spearhead-ea/island/releases{/id}","deployments_url":"https://api.github.com/repos/spearhead-ea/island/deployments","created_at":"2015-02-03T10:25:02Z","updated_at":"2018-10-24T08:30:34Z","pushed_at":"2018-10-25T01:03:19Z","git_url":"git://github.com/spearhead-ea/island.git","ssh_url":"git@github.com:spearhead-ea/island.git","clone_url":"https://github.com/spearhead-ea/island.git","svn_url":"https://github.com/spearhead-ea/island","homepage":"","size":1013,"stargazers_count":18,"watchers_count":18,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":16,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":16,"open_issues":19,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spearhead-ea/island/pulls/284"},"html":{"href":"https://github.com/spearhead-ea/island/pull/284"},"issue":{"href":"https://api.github.com/repos/spearhead-ea/island/issues/284"},"comments":{"href":"https://api.github.com/repos/spearhead-ea/island/issues/284/comments"},"review_comments":{"href":"https://api.github.com/repos/spearhead-ea/island/pulls/284/comments"},"review_comment":{"href":"https://api.github.com/repos/spearhead-ea/island/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spearhead-ea/island/pulls/284/commits"},"statuses":{"href":"https://api.github.com/repos/spearhead-ea/island/statuses/e85c7a0d14bea9819f7e331ce5a2d5fffa508455"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"heycalmdown"}}