zhangshenghang opened a new issue, #13504:
URL: https://github.com/apache/seatunnel/issues/13504

   ### Search before asking
   
   - [x] I searched the existing issues and found none covering 
`getCheckpointHistory` failing on an operation thread.
   
   ### SeaTunnel Version
   
   dev (`ee0fb0d72f`), `3.1.1-SNAPSHOT`
   
   ### Description
   
   `JobClient#getCheckpointHistory(jobId, pipelineId, limit, status)` always 
fails on the master with:
   
   ```
   java.lang.AssertionError: Waiting for response on this thread is illegal
       at 
com.hazelcast.spi.impl.AbstractInvocationFuture.registerWaiter(AbstractInvocationFuture.java:1155)
       at 
com.hazelcast.spi.impl.AbstractInvocationFuture.get(AbstractInvocationFuture.java:606)
       at 
com.hazelcast.map.impl.proxy.MapProxySupport.invokeOperation(MapProxySupport.java:480)
       at 
com.hazelcast.map.impl.proxy.MapProxySupport.getInternal(MapProxySupport.java:372)
       at com.hazelcast.map.impl.proxy.MapProxyImpl.get(MapProxyImpl.java:123)
       at 
org.apache.seatunnel.engine.server.common.statestore.checkpoint.hazelcast.HazelcastCheckpointOverviewStateStore.get(HazelcastCheckpointOverviewStateStore.java:64)
       at 
org.apache.seatunnel.engine.server.checkpoint.monitor.CheckpointMonitorService.getHistory(CheckpointMonitorService.java:205)
       at 
org.apache.seatunnel.engine.server.operation.GetCheckpointHistoryOperation.run(GetCheckpointHistoryOperation.java:64)
       at 
com.hazelcast.spi.impl.operationservice.impl.OperationRunnerImpl.run(OperationRunnerImpl.java:248)
       ...
   ```
   
   `GetCheckpointHistoryOperation#run` executes on a Hazelcast operation 
thread, and it calls `CheckpointMonitorService#getHistory`, which reads the 
checkpoint overview through a blocking `IMap#get` 
(`HazelcastCheckpointOverviewStateStore#get`). Hazelcast forbids blocking waits 
on operation threads, so every client request for checkpoint history fails 
instead of returning the retained history.
   
   The REST endpoint `GET /jobs/checkpoints/history` is unaffected because its 
servlet reads the same data on a Jetty thread; only the client protocol 
operation is broken. This makes the Java client API (and anything else that 
goes through `SeaTunnelGetCheckpointHistoryCodec`) unusable.
   
   ### Steps to reproduce
   
   1. Start a Zeta cluster (an in-JVM master plus one worker is enough).
   2. Submit a streaming job with checkpointing enabled and wait for one 
completed checkpoint.
   3. Call `new 
SeaTunnelClient(clientConfig).getJobClient().getCheckpointHistory(jobId, 1, 20, 
null)`.
   
   The call fails with the `AssertionError` above; the master logs the same 
stack under `GetCheckpointHistoryOperation`. The failure is independent of the 
job state and of whether `pipelineId`/`status` are provided.
   
   ### Expected behavior
   
   The call returns the retained checkpoint history for the requested 
job/pipeline, matching the JSON returned by `GET /jobs/checkpoints/history`.
   
   ### Suggested fix direction
   
   Do not block an operation thread on a distributed map read: make 
`GetCheckpointHistoryOperation` asynchronous/offloaded (complete the response 
from the executor that performs the read), or serve the history from a local 
snapshot that does not require a blocking `IMap#get`.
   


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