Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Manual completion client's recordHeartbeat swallows cancellation, reset and pause exceptions

Đang mở
#2,983 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@dplyukhin đang làm issue này rồi.

Từ ngày 11/8/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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:
Ngôn ngữ chính
Java
Star
434
Fork
252
Merge trung bình
3 ngày 15 phút
Pull request đã merge (30 ngày)
13

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của temporalio/sdk-java

Tất cả issue của temporalio/sdk-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.