Your are right that it's not thread-safety.
I think we can use Collections.synchronizedList() to get a thread-safety list[1].
And remove the synchronized keyword from the invoke interface.
I have created a ticket to track this[2], please feel free to fix it by make a pull request.
Best Regards,Zhenghua Gao
Hi all,
The class CollectSink is not thread safe as only the write to the values collection are synchronized but not the read: CollectSink.values.containsAll(...). Maybe if you use a CopyOnWriteArrayList instead of an ArrayList and remove the synchronized key work it should be ok.
Romain