Tranquility Core - Intermittent Error: "Java::JavaLang::IllegalStateException: sendAll failed"

Hello,

I’m working on implementing the Tranquility Core API into my JRuby application. I’ve been following the example here: https://github.com/gianm/tranquility-example/blob/master/src/main/java/io/imply/tranquility/JavaExample.java and implementing it in JRuby. I got it to a point that I thought was complete and when I tested it, it successfully wrote data to Druid. However, I’ve been testing it since and it only works 50% or less of the time. I downloaded the JavaExample and have it using the same classpath as my JRuby application, the example works every time.

The error it gives me is below, which comes from here: https://github.com/druid-io/tranquility/blob/master/core/src/main/scala/com/metamx/tranquility/tranquilizer/Tranquilizer.scala#L306

Java::JavaLang::IllegalStateException: sendAll failed

``

When it’s successful, I see a message similar to this in my console
Jun 07, 2016 8:54:33 PM com.twitter.finagle.Init$$anonfun$1 apply$mcV$sp

INFO: Finagle version 6.31.0 (rev=50d3bb0eea5ad3ed332111d707184c80fed6a506) built at 20151203-164135

``

I’m looking for any pointers on what might be causing this error. I mean, it seems like for some reason Finangle isn’t getting initialized some of the time, but I don’t really know where to hunt down the issue.

Thanks in advance.

base.rb (2.26 KB)

I fixed my error. After posting this, I noticed I was getting inconsistent warnings when running the code. Sometimes I would get no warning, below are the two it was cycling between.

warning: ambiguous Java methods found, using builder(scala.Function1)

``

warning: ambiguous Java methods found, using builder(com.metamx.tranquility.typeclass.Timestamper)

``

My issue was calling DruidBeams.builder was not consistently resolving to the correct overload. In JRuby there is a nice method called java_alias that allows you to specify the overload with a new method name. After implementing this, I’m consistently able to write to Druid.

Best Regards.