You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2022/08/23 14:30:14 UTC

[GitHub] [accumulo] dlmarion commented on issue #2889: Thousands of ProxyServer updates get silently lost if BatchWriter is closed right after the last update has been sent

dlmarion commented on issue #2889:
URL: https://github.com/apache/accumulo/issues/2889#issuecomment-1224158989

   A lot of information here, thanks for the detailed explanation. I have not read through all of it yet, but I wanted to make an observation about this:
   
   > The methods flush(), close(), addMutation() etc. in the BatchWriter
   of the Accumulo Core client library are all marked "synchronized" but the
   shared internal resources itself, especially the boolean closed, the
   MutationSet mutations, and the long integer totalMemUsed are not
   protected from simultaneous use by different threads.
   "Synchronized" means that close() cannot be run at the same time by
   two threads but it still can run while addMutation() is runnig, for
   example.
   > Here, addMutation() can be running and in a waiting state (for background
   jobs to write data to Accumulo) while close() is run by a new thread
   which then prevents addMutation() from finishing. (More on this
   further down.)
   
   If I were to write a program in Java that had multiple threads writing to a batch writer, *only* addMutation would be called from the threads. The main thread of the program would wait for all of the other threads to finish, then the main thread would call close.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

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