{"action":"created","issue":{"url":"https://api.github.com/repos/postgres-x2/postgres-x2/issues/325","repository_url":"https://api.github.com/repos/postgres-x2/postgres-x2","labels_url":"https://api.github.com/repos/postgres-x2/postgres-x2/issues/325/labels{/name}","comments_url":"https://api.github.com/repos/postgres-x2/postgres-x2/issues/325/comments","events_url":"https://api.github.com/repos/postgres-x2/postgres-x2/issues/325/events","html_url":"https://github.com/postgres-x2/postgres-x2/pull/325","id":149716757,"number":325,"title":"pooler deadloop and amount of startup process","user":{"login":"xuegang","id":10717876,"avatar_url":"https://avatars.githubusercontent.com/u/10717876?v=3","gravatar_id":"","url":"https://api.github.com/users/xuegang","html_url":"https://github.com/xuegang","followers_url":"https://api.github.com/users/xuegang/followers","following_url":"https://api.github.com/users/xuegang/following{/other_user}","gists_url":"https://api.github.com/users/xuegang/gists{/gist_id}","starred_url":"https://api.github.com/users/xuegang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xuegang/subscriptions","organizations_url":"https://api.github.com/users/xuegang/orgs","repos_url":"https://api.github.com/users/xuegang/repos","events_url":"https://api.github.com/users/xuegang/events{/privacy}","received_events_url":"https://api.github.com/users/xuegang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-20T09:41:37Z","updated_at":"2016-04-21T05:47:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/postgres-x2/postgres-x2/pulls/325","html_url":"https://github.com/postgres-x2/postgres-x2/pull/325","diff_url":"https://github.com/postgres-x2/postgres-x2/pull/325.diff","patch_url":"https://github.com/postgres-x2/postgres-x2/pull/325.patch"},"body":"Hi Suzuki,\r\n   In my production environment, Sometimes I can't connect to coordinator, and amount of startup process. There is not any DDL statement in my environment.\r\n   and there is not any error message. Based on the pstack. I doubted that the pooler process is in the deadloop.So I changed the code.\r\n\r\n   In the function:\r\n    \r\n  \r\n  \r\n  #define POOLER_RETRY_MAX 3\r\n\r\n  static PGXCNodePoolSlot *\r\n  acquire_connection(DatabasePool *dbPool, Oid node)\r\n  {\r\n\t\tslot = nodePool->slot[--(nodePool->freeSize)];\r\n\r\n\t\tint count = 0;\r\n\r\n\tretry:\r\n\t\t/*\r\n\t\t * Make sure connection is ok, destroy connection slot if there is a\r\n\t\t * problem.\r\n\t\t */\r\n\t    count=count+1;\r\n\t\tpoll_result = pqReadReady((PGconn *) slot->conn);\r\n\r\n\t\tif (poll_result == 0)\r\n\t\t\tbreak; \t\t/* ok, no data */\r\n\t\telse if (poll_result < 0)\r\n\t\t{\r\n\t\t\tif ((errno == EAGAIN || errno == EINTR) &&(count<POOLER_RETRY_MAX))\r\n\t\t\t\tgoto retry;\r\n\r\n   \r\n  }\r\n\r\nSo if retry is more than three times. I will destroy this slot."},"comment":{"url":"https://api.github.com/repos/postgres-x2/postgres-x2/issues/comments/212753057","html_url":"https://github.com/postgres-x2/postgres-x2/pull/325#issuecomment-212753057","issue_url":"https://api.github.com/repos/postgres-x2/postgres-x2/issues/325","id":212753057,"user":{"login":"xuegang","id":10717876,"avatar_url":"https://avatars.githubusercontent.com/u/10717876?v=3","gravatar_id":"","url":"https://api.github.com/users/xuegang","html_url":"https://github.com/xuegang","followers_url":"https://api.github.com/users/xuegang/followers","following_url":"https://api.github.com/users/xuegang/following{/other_user}","gists_url":"https://api.github.com/users/xuegang/gists{/gist_id}","starred_url":"https://api.github.com/users/xuegang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xuegang/subscriptions","organizations_url":"https://api.github.com/users/xuegang/orgs","repos_url":"https://api.github.com/users/xuegang/repos","events_url":"https://api.github.com/users/xuegang/events{/privacy}","received_events_url":"https://api.github.com/users/xuegang/received_events","type":"User","site_admin":false},"created_at":"2016-04-21T05:47:20Z","updated_at":"2016-04-21T05:47:20Z","body":"OK, Thanks for your quick response."}}