Manual completion client's recordHeartbeat swallows cancellation, reset and pause exceptions
I maintainer di solito rispondono entro 1 giorno
@dplyukhin ci sta già lavorando.
Dal 11/8/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Expected Behavior
ManualActivityCompletionClient.recordHeartbeat should throw ActivityCanceledException,
ActivityResetException or ActivityPausedException when the server reports cancellation, reset or
pause. The method already builds those exceptions.
The declaration on the public interface should change too. recordHeartbeat is declared
throws CanceledFailure, a type the method never throws. It should name what callers really have to
handle:
// io.temporal.activity.ManualActivityCompletionClient
void recordHeartbeat(@Nullable Object details) throws ActivityCompletionException;
Actual Behavior
ActivityCanceledException, ActivityResetException and ActivityPausedException never reach the
caller. The try block wraps the response checks along with the RPC, so catch (Exception e) catches
all three. processException then turns each one into ActivityCompletionFailureException.
// ManualActivityCompletionClientImpl.java, same on main as of d310594f
try {
RecordActivityTaskHeartbeatResponse status = ActivityClientHelper.sendHeartbeatRequest(...);
if (status.getCancelRequested()) {
throw new ActivityCanceledException(); // caught below, never reaches the caller
} else if (status.getActivityReset()) {
throw new ActivityResetException(); // same
} else if (status.getActivityPaused()) {
throw new ActivityPausedException(); // same
}
...
} catch (Exception e) {
processException(e);
}
The caller now sees the same exception for a cancelled activity and for a failed heartbeat RPC. The only
way to tell them apart is to unwrap getCause().
The recordActivityTaskHeartbeatById branch has the same problem. The worker-side path does not.
HeartbeatContextImpl.sendHeartbeatRequest checks the flags outside its catch block, so
ActivityExecutionContext.heartbeat throws the specific type.
Specifications
- Version: 1.37.0
- Platform:
- Lingua principale
- Java
- Stelle
- 434
- Fork
- 252
- Merge medio
- 6g 5h
- PR unite (30g)
- 25
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di temporalio/sdk-java
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
temporalio/sdk-java#2676 · 8 commenti · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
temporalio/sdk-java#1825 ·
I maintainer di solito rispondono entro 1 giorno
-
test server
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
temporalio/sdk-java#3088 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Warn if the SDK tried to send a payload above a specific size - JavaForse già presa @jmaeagle99 l’ha presa 18 giorni fa. Aperta
temporalio/sdk-java#3059 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Allow configurable prefix for MDC keysForse già presa @maciejdudko l’ha presa 18 giorni fa. Apertaenhancement
temporalio/sdk-java#3058 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di temporalio/sdk-java
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OpenAPITools/openapi-generator#25014 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
openhab/openhab-core#5847 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
apache/parquet-java#3820 ·
I maintainer di solito rispondono entro 1 giorno