{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch-py/issues/129","repository_url":"https://api.github.com/repos/elastic/elasticsearch-py","labels_url":"https://api.github.com/repos/elastic/elasticsearch-py/issues/129/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch-py/issues/129/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch-py/issues/129/events","html_url":"https://github.com/elastic/elasticsearch-py/issues/129","id":43846394,"number":129,"title":"ReadTimeoutError raised while calling es.indices.optimize(index='', wait_for_merge=True)","user":{"login":"shihpeng","id":651300,"avatar_url":"https://avatars.githubusercontent.com/u/651300?v=3","gravatar_id":"","url":"https://api.github.com/users/shihpeng","html_url":"https://github.com/shihpeng","followers_url":"https://api.github.com/users/shihpeng/followers","following_url":"https://api.github.com/users/shihpeng/following{/other_user}","gists_url":"https://api.github.com/users/shihpeng/gists{/gist_id}","starred_url":"https://api.github.com/users/shihpeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shihpeng/subscriptions","organizations_url":"https://api.github.com/users/shihpeng/orgs","repos_url":"https://api.github.com/users/shihpeng/repos","events_url":"https://api.github.com/users/shihpeng/events{/privacy}","received_events_url":"https://api.github.com/users/shihpeng/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2014-09-25T02:56:31Z","updated_at":"2016-12-03T10:40:14Z","closed_at":"2014-09-29T07:18:10Z","body":"I am using the following code to optimize indices after indexing my documents. However, a `ReadTimeoutError` was raised, but there is no any option that I can change the connection timeout setting.\n\n```\nes.indices.optimize(index='', wait_for_merge=True)\n```\n\nThe backtrace of the raised error:\n\n```\n\nTraceback (most recent call last):\n  File \"./main.py\", line 249, in <module>\n    main()\n  File \"./main.py\", line 240, in main\n    es.indices.optimize(index='', wait_for_merge=True)\n  File \"/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/elasticsearch/client/utils.py\", line 67, in _wrapped\n    return func(*args, params=params, **kwargs)\n  File \"/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/elasticsearch/client/indices.py\", line 734, in optimize\n    _, data = self.transport.perform_request('POST', _make_path(index, '_optimize'), params=params)\n  File \"/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/elasticsearch/transport.py\", line 276, in perform_request\n    status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)\n  File \"/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/elasticsearch/connection/http_urllib3.py\", line 51, in perform_request\n    raise ConnectionError('N/A', str(e), e)\nelasticsearch.exceptions.ConnectionError: ConnectionError(HTTPConnectionPool(host='localhost', port=9200): Read timed out. (read timeout=10)) caused by: ReadTimeoutError(HTTPConnectionPool(host='localhost', port=9200): Read timed out. (read timeout=10))\n```\n"},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch-py/issues/comments/264631474","html_url":"https://github.com/elastic/elasticsearch-py/issues/129#issuecomment-264631474","issue_url":"https://api.github.com/repos/elastic/elasticsearch-py/issues/129","id":264631474,"user":{"login":"lockwooddev","id":867686,"avatar_url":"https://avatars.githubusercontent.com/u/867686?v=3","gravatar_id":"","url":"https://api.github.com/users/lockwooddev","html_url":"https://github.com/lockwooddev","followers_url":"https://api.github.com/users/lockwooddev/followers","following_url":"https://api.github.com/users/lockwooddev/following{/other_user}","gists_url":"https://api.github.com/users/lockwooddev/gists{/gist_id}","starred_url":"https://api.github.com/users/lockwooddev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lockwooddev/subscriptions","organizations_url":"https://api.github.com/users/lockwooddev/orgs","repos_url":"https://api.github.com/users/lockwooddev/repos","events_url":"https://api.github.com/users/lockwooddev/events{/privacy}","received_events_url":"https://api.github.com/users/lockwooddev/received_events","type":"User","site_admin":false},"created_at":"2016-12-03T10:40:14Z","updated_at":"2016-12-03T10:40:14Z","body":"On elasticsearch 2.3.5 and python client (2.3) using the same endpoint, now called Force Merge, passing the `wait_for_merge` is still ignored and will eventually throw a ReadTimeoutError. \r\n\r\nAlso note that there is no such parameter for elasticsearch judging from the documentation.\r\nhttps://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-forcemerge.html\r\n\r\nFor now I will just try to catch the exception, as the operation is performed anyways. \r\n\r\n"}}
{"actor":{"display_login":"lockwooddev"}}