Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-1505

Transaction Status listener list gets overwritten

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Do
    • 3.1.4, 3.2.2
    • None
    • structure
    • None

    Description

      Transaction status listener is not called when using Gremlin Server

      • There are 2 different threads in action during the Gremlin Server initialization.
      1. The Groovy startup script evaluation which adds the listener
      2. 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<>();
              @Override
              protected List<Consumer<Transaction.Status>> initialValue() {
                  return list;
              }
          };
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            pluradj Jason Plurad
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: