-
Type: Improvement
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 10.10
-
Component/s: Events / Works
-
Release Notes Summary:Post-commit listeners have been converted to asynchronous listeners.
-
Tags:
-
Backlog priority:900
-
Upgrade notes:
-
Team:PLATFORM
-
Sprint:nxplatform 11.1.17
-
Story Points:3
The idea of the postCommit listener is to run just after the transaction and wait for completion with a short timeout.
The listener must implement PostCommitEventListener and marked as async=false (optionally postcommit=true), other combination results in and Async call instead of PostCommit.
Instead of using the WM, the listener is executed in a dedicated thread pool, the transaction thread wait 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.
Examples:
- EventCounterListener
- Bulk mode see below
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 wait for a reply, this creates complex bugs
Nothing prevents to do the same “pseudo realtime” behavior using directly the afterCompletion, this is already done for the elasticsearch indexing
For these reasons there should be no usage or the postCommit listeners at least on CRUD operation that need to scale,
-> the EventCounterListener should be removed or turn into an async listener.
-> it might be ok to keep the one in the Bulk mode which is only used with the importer (and it can be disabled)
-> check for other known postCommit listeners
- causes
-
NXDRIVE-2011 Remove post commit listeners warning
- Open
- depends on
-
NXP-6859 Add more monitoring features to the Admin center
- Resolved
- is related to
-
NXP-25314 Do a POC for event sourcing stream producer
- Resolved
-
NXP-12768 Warn the developer when listeners are incorrectly registered
- Open
-
NXP-27986 Deprecate post commit event listener execution
- Open
-
NXP-28012 Deprecate the Simon counters
- Resolved
- is required by
-
NXP-28033 Fix FT Kafka ERROR In log taggedVersionListener documentRestored
- Resolved
-
NXP-28190 Possible ConcurrentModificationException at startup from BlobProviderDocumentsUpdateListener
- Resolved
-
NXDOC-1975 Document the warning about post commit event listener future deprecation
- Resolved