{"action":"created","issue":{"url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch/issues/2","labels_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch/issues/2/comments","events_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch/issues/2/events","html_url":"https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/2","id":47445706,"number":2,"title":"Update Elasticsearch Output Plugin to retry bulk","user":{"login":"talevy","id":388837,"avatar_url":"https://avatars.githubusercontent.com/u/388837?v=3","gravatar_id":"","url":"https://api.github.com/users/talevy","html_url":"https://github.com/talevy","followers_url":"https://api.github.com/users/talevy/followers","following_url":"https://api.github.com/users/talevy/following{/other_user}","gists_url":"https://api.github.com/users/talevy/gists{/gist_id}","starred_url":"https://api.github.com/users/talevy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talevy/subscriptions","organizations_url":"https://api.github.com/users/talevy/orgs","repos_url":"https://api.github.com/users/talevy/repos","events_url":"https://api.github.com/users/talevy/events{/privacy}","received_events_url":"https://api.github.com/users/talevy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch/labels/O%283%29","name":"O(3)","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2014-10-31T21:19:41Z","updated_at":"2015-01-08T03:26:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch/pulls/2","html_url":"https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/2","diff_url":"https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/2.diff","patch_url":"https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/2.patch"},"body":"Some actions may fail within the ES client bulk call.\r\nNow, some messages (specifically errors 429 and 503s) will be\r\nretried up to 3 times. If there are still actions that are\r\nunsuccessfully indexed, Stud Buffer will continue its current\r\nbehavior (to retry indefinitely).\r\n\r\nStud Buffer will replay all events it first attempted to flush\r\nto Elasticsearch. This means duplicate events may find themselves\r\nin Elasticsearch.\r\n\r\n(migrated from https://github.com/elasticsearch/logstash/pull/1997 with a few modifications to make \r\ntests run once plugin is installed)"},"comment":{"url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch/issues/comments/69131051","html_url":"https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/2#issuecomment-69131051","issue_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch/issues/2","id":69131051,"user":{"login":"colinsurprenant","id":2010,"avatar_url":"https://avatars.githubusercontent.com/u/2010?v=3","gravatar_id":"","url":"https://api.github.com/users/colinsurprenant","html_url":"https://github.com/colinsurprenant","followers_url":"https://api.github.com/users/colinsurprenant/followers","following_url":"https://api.github.com/users/colinsurprenant/following{/other_user}","gists_url":"https://api.github.com/users/colinsurprenant/gists{/gist_id}","starred_url":"https://api.github.com/users/colinsurprenant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinsurprenant/subscriptions","organizations_url":"https://api.github.com/users/colinsurprenant/orgs","repos_url":"https://api.github.com/users/colinsurprenant/repos","events_url":"https://api.github.com/users/colinsurprenant/events{/privacy}","received_events_url":"https://api.github.com/users/colinsurprenant/received_events","type":"User","site_admin":false},"created_at":"2015-01-08T03:26:20Z","updated_at":"2015-01-08T03:26:20Z","body":"We're getting there :)\r\n- The class is getting big and I think it would help if all `public`/`protected`/`private` methods would be grouped together in that order. we could write `protected` and `private` just once before each group.  I would also verify each method visibility to make sure the `protected` & `public` methods have the correct access or if we could make them `private`.\r\n- The `register` method is too big.\r\n- The `@@plugins` initialization is in the middle of the class between methods, I'd move that before the first method definition as this is class initialization code.\r\n- I don't understand what the `@@plugins` code in the `register` method does and it looks fishy to me.\r\n- Still need to resolve the potential concurrent client call between the flush/submit and retry_flush/submit threads.\r\n- I am a bit puzzled over the lack of explicit JSon serializing for the bulk requests!? where is it done? ideally we'd want to control that by using `event.to_json` or `LogStash::Json.dump` on the `event.to_hash`. But by using` event.to_json`, this could potentially benefit eventual event json serialization caching"}}