Manual completion client's recordHeartbeat swallows cancellation, reset and pause exceptions
@dplyukhin ya está trabajando en esto.
Desde el 11/8/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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:
- Lenguaje dominante
- Java
- Estrellas
- 433
- Forks
- 249
- Merge medio
- 6 d 5 h
- PR fusionados (30 d)
- 25
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de temporalio/sdk-java
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
temporalio/sdk-java#2676 · 8 comentarios · 2 reacciones ·
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
temporalio/sdk-java#1825 ·
-
test server
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
temporalio/sdk-java#3088 · 2 comentarios ·
-
temporalio/sdk-java#3059 · 1 asignado ·
-
enhancement
temporalio/sdk-java#3058 · 1 asignado ·
Todos los issues de temporalio/sdk-java
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
HL7/fhir-ig-publisher#1375 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
-
Flaky: a relaunched catch-up replay can still report catching up right after its marker is written Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
johanhaleby/occurrent#1134 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
objectionary/jeo-maven-plugin#1811 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100