DanielCarter-stack commented on issue #10570:
URL: https://github.com/apache/seatunnel/issues/10570#issuecomment-4011121974

   <!-- code-pr-reviewer -->
   Thanks for reporting this. This is a valid initialization order bug.
   
   **Root cause:** `CheckpointMonitorService` retrieves the 
`engine_checkpoint_monitor` IMap in its constructor, which is called during 
`SeaTunnelServer.startMaster()` (line 186-191). Since `startMaster()` is 
invoked within `SeaTunnelServer.init()`—a Hazelcast service initialization 
callback—this triggers MapStore's `initial-mode: EAGER` loading before 
PartitionService is fully initialized, causing the NPE at `Invocation:209`.
   
   **Evidence:**
   - `CheckpointMonitorService:53-56` - eagerly gets IMap in constructor
   - `SeaTunnelServer:186-191` - creates CheckpointMonitorService during 
Hazelcast init
   - `CoordinatorService:404-413` - demonstrates correct deferred IMap 
initialization via `initCoordinatorService()` called later
   
   **Workaround:** Exclude `engine_checkpoint_monitor` from EAGER mode or 
switch to LAZY mode:
   ```yaml
   hazelcast:
     map:
       engine_checkpoint_monitor:
         map-store:
           enabled: false
   ```
   
   **Fix:** Refactor `CheckpointMonitorService` to defer IMap retrieval 
(similar to `CoordinatorService.initCoordinatorService()`), or lazy-initialize 
on first access.
   
   Could you confirm if `engine_checkpoint_monitor` requires persistence?


-- 
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]

Reply via email to