Map the `failure` field of the task status response
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Start by reading TaskStatusPollResponse and TaskStatusMetadata in ai.docling.serve.api.task.response, then trace how the Jackson 2 and Jackson 3 default mappers handle unknown enum values, including the behavior of user supplied mappers. Decide the enum policy before adding TaskFailureInfo and the failure field. Done means the response model maps the failure data safely under that policy, with the related metadata and error item drift handled or explicitly left out of scope.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Background
#776 added errorMessage to TaskStatusPollResponse, mapped from the error_message that Docling Serve returns on a failed task (see #775). Upstream TaskStatusResponse carries a second, richer failure field that we still don't map:
class TaskStatusResponse(BaseModel):
...
error_message: Optional[str] = None # mapped by #776
failure: Optional[PublicFailureInfo] = None # not mapped
class PublicFailureInfo(BaseModel):
category: FailureCategory
message: str
retryable: bool
phase: FailurePhase
details: dict[str, str] = Field(default_factory=dict)
Why it is worth mapping
retryable is the main draw: it lets a caller decide whether to resubmit without parsing an error string. category and phase let a caller tell a bad input apart from a service outage.
failure.message is also more specific than error_message for the same failure. error_message is built by build_public_task_error, which returns the real exception text for only four exception types and otherwise returns the constant "Internal processing error.". For those same cases failure.message says things like "Task exceeded the allowed execution time." or "Source document could not be reached.".
Why it was left out of #776
- Ray only. Of the three orchestrators in
docling-jobkit, only the Ray dispatcher populatesfailure. The local orchestrator (whatDoclingServeContainerruns) and the RQ orchestrator seterror_messageonly. - v1.25.0+.
failurefirst appears in docling-serve v1.25.0, whereaserror_messageis returned by every tag in our compatibility table, back to v1.18.0.
error_message was therefore the right field for the bug fix. failure is additive value for Ray deployments.
Decision needed first: unknown enum values
Mapping failure means introducing FailureCategory (9 values today) and FailurePhase (4 values) into docling-serve-api.
We have no policy for unknown enum values anywhere in the repo — no READ_UNKNOWN_ENUM_VALUES_AS_NULL, no @JsonEnumDefaultValue. A constant added upstream would be a hard deserialization failure across the whole version range we test against.
TaskStatus gets away with this only because its value domain is genuinely frozen at four: the values actually assigned come from jobkit's own TaskStatus, not the wider ConversionStatus that the response model nominally declares. FailureCategory is documented upstream as shared across task and document scope and extensible, so it will grow.
Options:
- Map
category/phaseasString. No breakage risk, no type safety. - Map as enums with an
UNKNOWNconstant and@JsonEnumDefaultValue. Needs to hold for both the Jackson 2 and Jackson 3 mappers, including user-supplied ones. - Map as enums and set
READ_UNKNOWN_ENUM_VALUES_AS_NULLon both default mappers. Does not help a consumer who brings their own mapper.
Worth settling repo-wide rather than only for this field.
Scope
- Add
TaskFailureInfotoai.docling.serve.api.task.response, following the Lombok /@Jacksonized/ builder conventions already used byTaskStatusPollResponseandTaskStatusMetadata. - Add the
failurefield toTaskStatusPollResponse. - Resolve the enum question above.
- Do not change the
AsyncOperationsfailure message to preferfailure.message. It is Ray-only, soerror_messagestays the source for the message text;failureis data for callers.
Related drift
Two other places where our mirrors have fallen behind upstream, same root cause. Possibly worth folding in, possibly worth splitting out:
TaskStatusMetadatais missingnum_partially_succeeded(upstreamTaskProcessingMetahas five fields, we map four).ErrorItemis missingcategoryandpage_no.
- Ngôn ngữ chính
- Java
- Star
- 144
- Fork
- 31
- Merge trung bình
- 1 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 51
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của docling-project/docling-java
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
docling-project/docling-java#765 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:docling-serve module:docling-serve-api module:docling-serve-client
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
docling-project/docling-java#697 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
docling-project/docling-java#557 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Increase code coverageCó thể đã có người làm @Abmarne đã nhận 270 ngày trước. Đang mởarea:docling-serve documentation good first issue help wanted module:docling-core module:docling-serve-api module:docling-serve-client module:docling-testcontainers
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
docling-project/docling-java#350 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Make version tester more rigorousCó thể làm lại được @Liljis đã nhận 270 ngày trước và không có pull request nào đang mở. Đang mởautomation enhancement module:version-tester
docling-project/docling-java#134 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của docling-project/docling-java
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
micronaut-projects/micronaut-core#14585 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Mend: dependency security vulnerability untriaged
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
opensearch-project/cross-cluster-replication#1805 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 3 ngày
-
feature request needs triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 66/100
TeamNewPipe/NewPipe#14083 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
NeoForge 安装任务的子任务描述有误Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
PCL-Community/PCL-CE#3907 ·
Maintainer thường phản hồi trong vòng 1 ngày