daniancu commented on PR #55: URL: https://github.com/apache/sling-org-apache-sling-event/pull/55#issuecomment-4253169900
## Changes since initial PR **Commit 2 — Harden scheduler lifecycle** - Use `AtomicReference<ScheduledExecutorService>` instead of `volatile` for thread-safe access - `startProcessing()` reads the scheduler into a local variable, handles null (already deactivated), and catches `RejectedExecutionException` (shutdown race) - `ManualScheduler` test fake now models realistic shutdown semantics - Added `testDeactivatePreventsDelayedNotification` covering deactivation clearing pending tasks and schedule/shutdown race safety **Commit 3 — Null scheduler tests** - `testStartProcessingWithNullScheduler`: covers `scheduler.get() == null` branch - `testDeactivateWithNullScheduler`: covers `deactivate()` when scheduler was never initialized, including double-deactivate **Commit 4 — Extract ManualScheduler** - Moved `ManualScheduler` from inner class to standalone package-private file **Commit 5 — Remove setScheduler from production code** - Removed the package-private `setScheduler()` setter from `JobManagerConfiguration` - Tests now inject the scheduler via reflection (same pattern as `startupDelayListener`) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
