Jason Plurad created TINKERPOP-1505:

             Summary: Transaction Status listener list gets overwritten
                 Key: TINKERPOP-1505
                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1505
             Project: TinkerPop
          Issue Type: Bug
          Components: process
    Affects Versions: 3.2.2, 3.1.4
            Reporter: Jason Plurad

Transaction status listener is not called when using Gremlin Server

* Caused by the transaction listener list initialization in 
  * There are 2 different threads in action during the Gremlin Server 
    # The Groovy startup script evaluation which adds the listener
    # The server itself handles the transaction commit or rollback. Both 
threads end up calling on the {{ThreadLocal initialValue()}} which returns 
{{new ArrayList()}} and effectively wipes out the listener.

    * Fix is to initialize the list once.

    protected final ThreadLocal<List<Consumer<Transaction.Status>>> 
transactionListeners = new ThreadLocal<List<Consumer<Transaction.Status>>>() {
        private List<Consumer<Transaction.Status>> list = new ArrayList<>();
        protected List<Consumer<Transaction.Status>> initialValue() {
            return list;

This message was sent by Atlassian JIRA

Reply via email to