[ 
https://issues.apache.org/jira/browse/ACCUMULO-3856?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Josh Elser updated ACCUMULO-3856:
---------------------------------
    Description: 
updateAndFlush creates a new BatchWriter, adds the updates, then tries to flush 
and close the BatchWriter.

If the flush or addMutations fails (such as the case in SimpleProxyBase ITs 
where we make sure that constraints fire), this will leak that BatchWriter 
threads.

The BatchWriter should be closed in a finally block.

  was:
Inspecting ProxyServer, saw the following:

{code}
  @Override
  public void update(String writer, Map<ByteBuffer,List<ColumnUpdate>> cells) 
throws TException {
    try {
      BatchWriterPlusException bwpe = getWriter(writer);
      addCellsToWriter(cells, bwpe);
    } catch (UnknownWriter e) {
      // just drop it, this is a oneway thrift call and throwing a TException 
seems to make all subsequent thrift calls fail
    }
  }
{code}

This means that calls to update which fail to get a BatchWriter (for whatever 
reason) will silently fail and appear to the user to have written data 
successfully. This is horrible.

I'm not sure what the comment means either. I'm not sure why throwing a 
TException from the server would invalidate the connection, but perhaps I'm 
just ignorant of some finer details.


> ProxyServer.updateAndFlush leaks BatchWriter 
> ---------------------------------------------
>
>                 Key: ACCUMULO-3856
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-3856
>             Project: Accumulo
>          Issue Type: Bug
>          Components: proxy
>            Reporter: Josh Elser
>            Priority: Critical
>             Fix For: 1.6.3, 1.8.0, 1.7.1
>
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> updateAndFlush creates a new BatchWriter, adds the updates, then tries to 
> flush and close the BatchWriter.
> If the flush or addMutations fails (such as the case in SimpleProxyBase ITs 
> where we make sure that constraints fire), this will leak that BatchWriter 
> threads.
> The BatchWriter should be closed in a finally block.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to