Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-27986

Deprecate post commit event listener execution

    XMLWordPrintable

    Details

      Description

      As mentioned inĀ NXP-26911:

      The idea of the post commit listener is to run just after the transaction and wait for completion with a short timeout.
      The listener must implement PostCommitEventListener and be marked as async="false". It is then handled by the PostCommitEventExecutor (if marked as async="true", it is handled by an asynchronous call instead).

      Instead of using the WorkManager, the post commit listener is executed in a dedicated thread pool and the transaction thread waits for completion (at least 300ms) before returning. This enables to do some processing after the transaction and before returning the HTTP response.

      To mitigate the randomness (sometimes 0.3s is not enough), the timeout is set to 1min when running tests.

      Post commit listeners are too complex and inefficient:

      • They use a dedicated large thread pool that can create up to 100 threads.
      • There is an overhead to reconnect events and session.
      • Under peak, it participates to collapse the platform by using more threads, transactions and connections
      • The "pseudo realtime" behavior is random depending on the time the main thread waits for a reply, this can create complex bugs.

      Nothing prevents to do the same "pseudo realtime" behavior using directly the afterCompletion, this is already done for the Elasticsearch indexing.

      After having removed all the post commit listeners with NXP-26911, let's deprecate the code related to the PostCommitEventExecutor.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: