bessbd commented on a change in pull request #320:
URL: https://github.com/apache/flume/pull/320#discussion_r418547719



##########
File path: 
flume-ng-sinks/flume-ng-elasticsearch-sink/src/main/java/org/apache/flume/sink/elasticsearch/client/ElasticSearchRestClient.java
##########
@@ -105,7 +105,7 @@ public void addEvent(Event event, IndexNameBuilder 
indexNameBuilder, String inde
     parameters.put(INDEX_OPERATION_NAME, indexParameters);
 
     Gson gson = new Gson();
-    synchronized (bulkBuilder) {

Review comment:
       If the `append`s happen in one call, there should be no race condition. 
Similarly, a `.setLength(0);` to empty the buffer should also allow for no race 
condition. Let me know if I've missed something. A second best option would be 
a dedicated lock object, IMHO.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to