Search code examples
javaaccumulo

Accumulo BatchWriter close() stuck forever


For example, when I use BatchWriter to write into accumulo, I use the code as follows:

BatchWriter writer =
    conn.createBatchWriter("table", memBuf, timeout, numThreads)

writer.add(mutation);
writer.close();

I figured out that the java code stuck in "writer.close()" when I have "writer.add(mutation)". But when I remove "writer.add(mutation);", it went through "writer.close()". Does anyone know how to solve the BatchWriter close() problem?


Solution

  • Check the Accumulo monitor for errors. If you only add one mutation, it will be sent to the servers when you close the BatchWriter (mutations are batched together for performance reasons). Your client is likely waiting on a response from at least one TabletServer.

    You can also collect a stackdump from your client and from your tabletserver(s), showing where the code is currently stuck (using jstack for example).