fix: Resolve sequencer last_start regression and gateway proxy concurrency crash#1336
fix: Resolve sequencer last_start regression and gateway proxy concurrency crash#1336khyatimahendru wants to merge 3 commits into
Conversation
…rency crash - Generalize sequencer last_start regression guard in SequenceBase.java to prevent backwards timestamps updates on out-of-order delivery. - Introduce ThreadSafeHashMap extending HashMap inside udmi.util to shield against ConcurrentModificationException during Jackson serialization. - Patched CatchingScheduledThreadPoolExecutor to unpack and log exceptions thrown by Scheduled Futures. - Integrated ThreadSafeHashMap inside PointsetManager.java to instantiate clean thread-safe state point maps.
|
Is there a better way to implement the ThreadSafeHashMap using a standard library class instead? Yes, there absolutely is! In fact, implementing a thread-safe map by extending HashMap and synchronizing every method is a classic "reinventing the wheel" anti-pattern in modern Java. While your current implementation solves the ConcurrentModificationException issue by returning snapshot copies in entrySet(), keySet(), and values(), it suffers from major performance bottlenecks because it synchronizes entire read and write operations on a single lock. |
grafnu
left a comment
There was a problem hiding this comment.
No need for a complete new class!
|
@grafnu I originally intended to use the standard Since |
Uh oh!
There was an error while loading. Please reload this page.